@blueking/open-telemetry 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/bk-rum.global.js +1 -1
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/core/config.d.ts +7 -4
- package/dist/core/runtime-context.d.ts +1 -1
- package/dist/core/url.d.ts +5 -0
- package/dist/index.js +430 -420
- package/dist/index.js.map +1 -1
- package/dist/schema/attributes.d.ts +1 -1
- package/package.json +1 -1
- package/skills/bk-rum-otele/SKILL.md +1 -1
- package/skills/bk-rum-otele/evals/evals.json +1 -1
- package/skills/bk-rum-otele/references/api.md +1 -1
- package/skills/bk-rum-otele/references/architecture.md +1 -1
- package/skills/bk-rum-otele/references/capabilities.md +1 -1
- package/skills/bk-rum-otele/references/configuration.md +5 -4
- package/skills/bk-rum-otele/references/framework-integration.md +7 -7
- package/skills/bk-rum-otele/references/getting-started.md +2 -2
- package/skills/bk-rum-otele/references/network.md +11 -3
- package/skills/bk-rum-otele/references/privacy.md +8 -6
- package/skills/bk-rum-otele/references/production.md +3 -3
- package/skills/bk-rum-otele/references/session-context.md +1 -1
- package/skills/bk-rum-otele/references/telemetry-reference.md +16 -12
- package/skills/bk-rum-otele/references/transport-sampling.md +2 -2
- package/skills/bk-rum-otele/references/troubleshooting.md +3 -3
- package/skills/bk-rum-otele/references/views-routing.md +9 -7
- package/dist/core/telemetry-attributes.d.ts +0 -3
package/dist/core/config.d.ts
CHANGED
|
@@ -71,8 +71,9 @@ export interface BkOTRequestConfig {
|
|
|
71
71
|
allowedTracingUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];
|
|
72
72
|
excludedUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];
|
|
73
73
|
beforeSend?: (event: BkOTRequestEvent, context: BkOTRequestContext) => boolean | void;
|
|
74
|
+
/** 返回请求 URL 的低基数模板,例如 `/api/orders/{id}`;返回空值时回退到默认折叠规则。 */
|
|
75
|
+
getUrlTemplate?: (url: string) => string | undefined;
|
|
74
76
|
}
|
|
75
|
-
export type BkOTRequestOutcome = RumRequestOutcome;
|
|
76
77
|
export type BkOTRequestContext = {
|
|
77
78
|
error?: unknown;
|
|
78
79
|
request: Request | RequestInit;
|
|
@@ -92,6 +93,7 @@ export interface BkOTRequestEvent {
|
|
|
92
93
|
url?: string;
|
|
93
94
|
};
|
|
94
95
|
}
|
|
96
|
+
export type BkOTRequestOutcome = RumRequestOutcome;
|
|
95
97
|
export type BkOTSpanProcessorMode = 'batch' | 'simple';
|
|
96
98
|
export interface BkOTTrackingConfig {
|
|
97
99
|
action?: BkOTActionPluginOptions | boolean;
|
|
@@ -124,8 +126,8 @@ export interface BkOTViewConfig {
|
|
|
124
126
|
/** 自动计算初始加载与 SPA 路由的页面稳定耗时,默认开启。 */
|
|
125
127
|
loadingTime?: boolean;
|
|
126
128
|
tracking?: 'auto' | 'manual';
|
|
127
|
-
/**
|
|
128
|
-
|
|
129
|
+
/** 返回页面路由的低基数模板,例如 `/trace/:id`;返回空值时回退到默认折叠规则。 */
|
|
130
|
+
getUrlTemplate?: (url: string) => string | undefined;
|
|
129
131
|
}
|
|
130
132
|
export interface ResolvedApplicationConfig {
|
|
131
133
|
environment: string;
|
|
@@ -154,7 +156,8 @@ export interface ResolvedConfigHooks {
|
|
|
154
156
|
getCustomAttributes: () => Attributes;
|
|
155
157
|
getErrorAttributes: () => Attributes;
|
|
156
158
|
getPageAttributes: () => Attributes;
|
|
157
|
-
|
|
159
|
+
getRequestUrlTemplate: (url: string) => string;
|
|
160
|
+
getViewUrlTemplate: (url: string) => string;
|
|
158
161
|
redactAttributes: (attributes: Attributes) => Attributes;
|
|
159
162
|
redactUrl: (url: string) => string;
|
|
160
163
|
}
|
package/dist/core/url.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { BkOTUrlMatcher, ResolvedBkOTConfig } from './config';
|
|
2
2
|
export declare const toAbsoluteUrl: (url: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* 常见数字 ID、UUID 和长十六进制段统一折叠为 :id,便于服务端按路由聚合。
|
|
5
|
+
* 同时服务 `view.url_template`(页面路由)与 `url.template`(请求路径)两个维度。
|
|
6
|
+
*/
|
|
7
|
+
export declare const normalizeUrlPathTemplate: (pathGroup: string) => string;
|
|
3
8
|
export declare const isBkOTEndpoint: (config: ResolvedBkOTConfig, url: string) => boolean;
|
|
4
9
|
export declare const shouldIgnoreUrl: (config: ResolvedBkOTConfig, url: string) => boolean;
|
|
5
10
|
export declare const matchesUrlList: (matchers: BkOTUrlMatcher | BkOTUrlMatcher[] | undefined, url: string) => boolean;
|