@blueking/open-telemetry 0.0.17 → 0.0.19
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/dist/bk-rum.global.js +2 -2
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +585 -664
- package/dist/index.js.map +1 -1
- package/dist/plugins/resource.d.ts +0 -1
- package/dist/plugins/web-vitals.d.ts +11 -11
- package/dist/schema/attributes.d.ts +0 -9
- package/dist/schema/span.d.ts +5 -15
- package/package.json +1 -1
- package/skills/bk-rum-otele/SKILL.md +2 -2
- package/skills/bk-rum-otele/references/api.md +1 -11
- package/skills/bk-rum-otele/references/capabilities.md +1 -1
- package/skills/bk-rum-otele/references/concepts.md +0 -4
- package/skills/bk-rum-otele/references/data-model.md +2 -20
- package/skills/bk-rum-otele/references/plugins.md +2 -2
- package/skills/bk-rum-otele/references/telemetry-reference.md +8 -20
|
@@ -14,7 +14,6 @@ export declare const getResourcePerformanceAttributes: (entry: ResourceTimingWit
|
|
|
14
14
|
'resource.decoded_body_size': number;
|
|
15
15
|
'resource.render_blocking_status'?: string | undefined;
|
|
16
16
|
'resource.delivery_type'?: string | undefined;
|
|
17
|
-
transfer_size: number;
|
|
18
17
|
"resource.cache.hit": boolean | undefined;
|
|
19
18
|
"resource.protocol": string;
|
|
20
19
|
};
|
|
@@ -37,6 +37,15 @@ interface EventTimingEntry extends PerformanceEntry {
|
|
|
37
37
|
processingStart?: number;
|
|
38
38
|
target?: EventTarget | null;
|
|
39
39
|
}
|
|
40
|
+
interface InpCandidate {
|
|
41
|
+
duration: number;
|
|
42
|
+
inputDelay: number;
|
|
43
|
+
interactionId: number;
|
|
44
|
+
interactionTarget?: string;
|
|
45
|
+
interactionType: string;
|
|
46
|
+
presentationDelay: number;
|
|
47
|
+
processingDuration: number;
|
|
48
|
+
}
|
|
40
49
|
interface LayoutShiftEntry extends PerformanceEntry {
|
|
41
50
|
hadRecentInput?: boolean;
|
|
42
51
|
sources?: Array<{
|
|
@@ -51,25 +60,16 @@ interface ViewVitalState {
|
|
|
51
60
|
clsWindowLargestShiftValue: number;
|
|
52
61
|
clsWindowStart?: number;
|
|
53
62
|
clsWindowValue: number;
|
|
63
|
+
id: string;
|
|
64
|
+
inpCandidates: InpCandidate[];
|
|
54
65
|
interactionCountAtStart?: number;
|
|
55
66
|
interactionIdMax: number;
|
|
56
67
|
interactionIdMin: number;
|
|
57
|
-
inpCandidates: InpCandidate[];
|
|
58
|
-
id: string;
|
|
59
68
|
largestShiftTarget?: string;
|
|
60
69
|
largestShiftValue: number;
|
|
61
70
|
runtimeAttributes: Attributes;
|
|
62
71
|
startedAt: number;
|
|
63
72
|
}
|
|
64
|
-
interface InpCandidate {
|
|
65
|
-
duration: number;
|
|
66
|
-
inputDelay: number;
|
|
67
|
-
interactionId: number;
|
|
68
|
-
interactionTarget?: string;
|
|
69
|
-
interactionType: string;
|
|
70
|
-
presentationDelay: number;
|
|
71
|
-
processingDuration: number;
|
|
72
|
-
}
|
|
73
73
|
export declare const isSameViewId: (currentViewId: string | undefined, nextViewId: string | undefined) => boolean;
|
|
74
74
|
export declare const updateViewCls: (view: ViewVitalState, entry: LayoutShiftEntry) => void;
|
|
75
75
|
export declare const updateViewInp: (view: ViewVitalState, entry: EventTimingEntry) => void;
|
|
@@ -20,9 +20,7 @@ export declare const RUM_ATTRIBUTES: {
|
|
|
20
20
|
readonly browserVersion: "browser.version";
|
|
21
21
|
readonly cacheHit: "resource.cache.hit";
|
|
22
22
|
readonly deviceType: "device.type";
|
|
23
|
-
readonly durationBucket: "duration_bucket";
|
|
24
23
|
readonly errorType: "error_type";
|
|
25
|
-
readonly eventLabel: "event_label";
|
|
26
24
|
readonly exceptionFingerprint: "exception.fingerprint";
|
|
27
25
|
readonly exceptionMessageShort: "exception.message_short";
|
|
28
26
|
readonly exceptionStackTopFrame: "exception.stack_top_frame";
|
|
@@ -45,13 +43,6 @@ export declare const RUM_ATTRIBUTES: {
|
|
|
45
43
|
readonly sessionStartTime: "session.start_time";
|
|
46
44
|
readonly spanSubtype: "span_subtype";
|
|
47
45
|
readonly spanType: "span_type";
|
|
48
|
-
readonly statusClass: "status_class";
|
|
49
|
-
readonly targetDomain: "target_domain";
|
|
50
|
-
readonly targetLabel: "target_label";
|
|
51
|
-
readonly targetPathTemplate: "target_path_template";
|
|
52
|
-
readonly targetValue: "target_value";
|
|
53
|
-
readonly traceScene: "trace_scene";
|
|
54
|
-
readonly transferSize: "transfer_size";
|
|
55
46
|
readonly userId: "user.id";
|
|
56
47
|
readonly vitalMetric: "vital.metric";
|
|
57
48
|
readonly vitalRating: "vital.rating";
|
package/dist/schema/span.d.ts
CHANGED
|
@@ -17,38 +17,28 @@ export declare const RUM_SPAN_TYPE: {
|
|
|
17
17
|
readonly vital: "vital";
|
|
18
18
|
};
|
|
19
19
|
export interface RumResourceSpanInput {
|
|
20
|
-
duration?: number;
|
|
21
20
|
initiatorType?: string;
|
|
22
21
|
method?: string;
|
|
23
22
|
networkError?: boolean;
|
|
24
23
|
responseStatus?: number;
|
|
25
24
|
transferSize?: number;
|
|
26
25
|
url: string;
|
|
27
|
-
urlPathTemplate?: string;
|
|
28
26
|
}
|
|
29
27
|
export interface RumSpanClassification {
|
|
30
|
-
duration?: number;
|
|
31
28
|
errorType?: string;
|
|
32
|
-
eventLabel?: string;
|
|
33
29
|
result?: RumSpanResult;
|
|
34
30
|
spanSubtype: string;
|
|
35
31
|
spanType: RumSpanType;
|
|
36
|
-
targetLabel?: string;
|
|
37
|
-
targetValue?: boolean | number | string;
|
|
38
|
-
traceScene?: string;
|
|
39
32
|
}
|
|
40
33
|
export type RumSpanResult = (typeof RUM_SPAN_RESULT)[keyof typeof RUM_SPAN_RESULT];
|
|
41
34
|
export type RumSpanType = (typeof RUM_SPAN_TYPE)[keyof typeof RUM_SPAN_TYPE];
|
|
42
35
|
export interface RumUrlTarget {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
pathTemplate?: string;
|
|
36
|
+
serverAddress?: string;
|
|
37
|
+
serverPort?: number;
|
|
46
38
|
}
|
|
47
|
-
export declare const getDurationBucket: (duration: number) => "<100ms" | "100~500ms" | "500ms~2s" | ">2s";
|
|
48
|
-
export declare const getStatusClass: (statusCode: number) => string;
|
|
49
39
|
export declare const getHttpResult: (statusCode: number | undefined) => RumSpanResult;
|
|
50
40
|
export declare const getHttpErrorType: (statusCode: number | undefined) => "none" | "network_timeout" | "http_5xx" | "http_4xx";
|
|
51
41
|
export declare const getVitalResult: (rating: string | undefined) => RumSpanResult;
|
|
52
|
-
export declare const getUrlTarget: (url: string | undefined
|
|
53
|
-
export declare const buildRumSpanAttributes: ({
|
|
54
|
-
export declare const buildRumResourceSpanAttributes: ({
|
|
42
|
+
export declare const getUrlTarget: (url: string | undefined) => RumUrlTarget;
|
|
43
|
+
export declare const buildRumSpanAttributes: ({ errorType, result, spanSubtype, spanType, }: RumSpanClassification) => Attributes;
|
|
44
|
+
export declare const buildRumResourceSpanAttributes: ({ initiatorType, method, networkError, responseStatus, transferSize, url, }: RumResourceSpanInput) => Attributes;
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ description: 帮助业务方在前端应用里接入、使用和配置蓝鲸 RUM
|
|
|
32
32
|
| 查公开 API(start/flush/shutdown/setUser/setView/reportAction/reportCustomEvent 等) | `references/api.md` |
|
|
33
33
|
| Vue / React / Vue Router / 微前端 集成 | `references/framework-integration.md` |
|
|
34
34
|
| URL 脱敏、属性脱敏、公共属性、低基数路由、user.id 处理 | `references/privacy.md` |
|
|
35
|
-
| 了解上报字段、span_type/result
|
|
35
|
+
| 了解上报字段、span_type/result、哪些字段是后端派生 | `references/data-model.md` |
|
|
36
36
|
| 查具体的 span 名 / metric 名 / log 事件名、完整属性字典 | `references/telemetry-reference.md` |
|
|
37
37
|
| 本地看不到数据、手动事件没上报、白屏误报、接口 span 太多等排障 | `references/troubleshooting.md` |
|
|
38
38
|
|
|
@@ -63,7 +63,7 @@ SDK 维护公共上下文并自动挂到后续 span/log 上:`user.id`(业务
|
|
|
63
63
|
|
|
64
64
|
### 数据归一
|
|
65
65
|
|
|
66
|
-
SDK 为 span 补充归一字段便于统一检索:`span_type`(document/resource/vital/error/longtask/action/route/custom)、`result`(success/warning/error/timeout/abort)、`
|
|
66
|
+
SDK 为 span 补充归一字段便于统一检索:`span_type`(document/resource/vital/error/longtask/action/route/custom)、`span_subtype`、`result`(success/warning/error/timeout/abort)、`error_type`。Fetch/XHR 与静态资源统一为 resource,通过 `resource.type` 区分。
|
|
67
67
|
|
|
68
68
|
## 最小接入速查
|
|
69
69
|
|
|
@@ -261,10 +261,7 @@ const plugin = createPlugin({
|
|
|
261
261
|
归一字段 key 常量。
|
|
262
262
|
|
|
263
263
|
```ts
|
|
264
|
-
|
|
265
|
-
name: 'biz_event',
|
|
266
|
-
attributes: { [RUM_ATTRIBUTES.targetLabel]: 'submit-order' },
|
|
267
|
-
});
|
|
264
|
+
const spanTypeKey = RUM_ATTRIBUTES.spanType; // 'span_type'
|
|
268
265
|
```
|
|
269
266
|
|
|
270
267
|
### RUM_SPAN_TYPE / RUM_SPAN_RESULT
|
|
@@ -278,18 +275,11 @@ const span = bkOT.startSpan('custom.cache_hit', {
|
|
|
278
275
|
...buildRumSpanAttributes({
|
|
279
276
|
spanType: RUM_SPAN_TYPE.custom,
|
|
280
277
|
spanSubtype: 'cache',
|
|
281
|
-
eventLabel: '业务缓存',
|
|
282
|
-
targetLabel: 'homepage',
|
|
283
|
-
targetValue: true,
|
|
284
278
|
}),
|
|
285
279
|
});
|
|
286
280
|
span.end();
|
|
287
281
|
```
|
|
288
282
|
|
|
289
|
-
### getDurationBucket(duration)
|
|
290
|
-
|
|
291
|
-
返回 `<100ms`、`100~500ms`、`500ms~2s`、`>2s` 之一。
|
|
292
|
-
|
|
293
283
|
### buildRumSpanAttributes 相关类型
|
|
294
284
|
|
|
295
285
|
公开 `RumSpanClassification`、`RumSpanType`、`RumSpanResult`,用于扩展插件保持同一归一模型。
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
- 创建和轮换 Session,划分初始加载、SPA、BFCache、手动和 Session 续期 View。
|
|
35
35
|
- 统一 patch Fetch/XHR;请求 span、活动计数、Trace Header、Resource Timing 和 Body 采集共用同一生命周期。
|
|
36
|
-
- 把浏览器事件归一为 `span_type`、`result`、`error_type
|
|
36
|
+
- 把浏览器事件归一为 `span_type`、`span_subtype`、`result`、`error_type` 等字段。
|
|
37
37
|
- 自动为 Span/Log 关联 `session.id`、`view.id`,为 Metric 保留低基数 `view.url_path_group`。
|
|
38
38
|
- 在 exporter 前执行采样、有效上下文、自上报请求和 `tracking.beforeSend` 过滤。
|
|
39
39
|
|
|
@@ -103,8 +103,6 @@ SDK 会为 span 补充 RUM 归一字段,例如:
|
|
|
103
103
|
|
|
104
104
|
- `span_type`:`document`、`resource`、`vital`、`error`、`longtask`、`action`、`route`、`custom`
|
|
105
105
|
- `result`:`success`、`warning`、`error`、`timeout`、`abort`
|
|
106
|
-
- `duration_bucket`:`<100ms`、`100~500ms`、`500ms~2s`、`>2s`
|
|
107
|
-
- `target_label`:跨类型的主标签,用于统一检索
|
|
108
106
|
|
|
109
107
|
示例:自定义 span 也可以复用归一字段构造器。
|
|
110
108
|
|
|
@@ -115,8 +113,6 @@ const span = bkOT.startSpan('custom.cache_warmup', {
|
|
|
115
113
|
...buildRumSpanAttributes({
|
|
116
114
|
spanType: RUM_SPAN_TYPE.custom,
|
|
117
115
|
spanSubtype: 'cache_warmup',
|
|
118
|
-
eventLabel: '缓存预热',
|
|
119
|
-
targetLabel: 'homepage',
|
|
120
116
|
}),
|
|
121
117
|
});
|
|
122
118
|
|
|
@@ -7,7 +7,7 @@ SDK 的数据模型遵循“浏览器 SDK 负责低成本原始数据和单事
|
|
|
7
7
|
## 分层模型
|
|
8
8
|
|
|
9
9
|
1. OpenTelemetry 原生字段:trace、span、resource、metric、log 的标准字段。
|
|
10
|
-
2. RUM 归一字段:`span_type`、`span_subtype`、`result`、`error_type
|
|
10
|
+
2. RUM 归一字段:`span_type`、`span_subtype`、`result`、`error_type` 等。
|
|
11
11
|
3. 运行时上下文:`user.id`、`session.id`、`view.id`、`view.url`、`view.url_path_group` 等。
|
|
12
12
|
4. 后端派生字段:session/view duration、count、地理信息、影响用户数、trace tree 分析等。
|
|
13
13
|
|
|
@@ -35,8 +35,6 @@ const span = bkOT.startSpan('custom.search', {
|
|
|
35
35
|
...buildRumSpanAttributes({
|
|
36
36
|
spanType: RUM_SPAN_TYPE.custom,
|
|
37
37
|
spanSubtype: 'search',
|
|
38
|
-
eventLabel: '业务搜索',
|
|
39
|
-
targetLabel: 'alarm',
|
|
40
38
|
}),
|
|
41
39
|
'biz.keyword_length': 6,
|
|
42
40
|
});
|
|
@@ -68,22 +66,6 @@ bkOT.reportCustomEvent({
|
|
|
68
66
|
});
|
|
69
67
|
```
|
|
70
68
|
|
|
71
|
-
## Duration Bucket
|
|
72
|
-
|
|
73
|
-
有耗时的事件会写入 `duration_bucket`:
|
|
74
|
-
|
|
75
|
-
- `<100ms`
|
|
76
|
-
- `100~500ms`
|
|
77
|
-
- `500ms~2s`
|
|
78
|
-
- `>2s`
|
|
79
|
-
|
|
80
|
-
```ts
|
|
81
|
-
import { getDurationBucket } from '@blueking/open-telemetry';
|
|
82
|
-
|
|
83
|
-
console.log(getDurationBucket(80)); // <100ms
|
|
84
|
-
console.log(getDurationBucket(1200)); // 500ms~2s
|
|
85
|
-
```
|
|
86
|
-
|
|
87
69
|
## SDK 直接采集
|
|
88
70
|
|
|
89
71
|
以下字段由浏览器 API、接入方配置或 SDK 运行期上下文直接提供:
|
|
@@ -92,7 +74,7 @@ console.log(getDurationBucket(1200)); // 500ms~2s
|
|
|
92
74
|
- 用户与会话:`user.id`、`session.id`
|
|
93
75
|
- View:`view.id`、`view.name`、`view.url`、`view.url_path_group`、`view.loading_type`
|
|
94
76
|
- 终端信息:`device.type`、`browser.name`、`browser.version`、`os.name`、`network.effective_type`
|
|
95
|
-
- HTTP / Resource:`http.request.method`、`http.response.status_code`、`url.full`、`
|
|
77
|
+
- HTTP / Resource:`http.request.method`、`http.response.status_code`、`url.full`、`resource.size`
|
|
96
78
|
- Web Vitals:`vital.metric`、`vital.value`、`vital.rating`
|
|
97
79
|
- Error Span 属性:`exception.message_short`、`exception.stack_top_frame`、`exception.fingerprint`;完整异常位于标准 `exception` Span Event
|
|
98
80
|
|
|
@@ -213,7 +213,7 @@ new BkOpenTelemetry({
|
|
|
213
213
|
});
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
常见字段包括 `
|
|
216
|
+
常见字段包括 `resource.type`、`resource.size`、`resource.protocol`、`url.full`、`server.address`。当 Resource Timing 数据可用时,还会上报:
|
|
217
217
|
|
|
218
218
|
- `resource.redirect.*`、`resource.dns.*`、`resource.connect.*`、`resource.ssl.*`
|
|
219
219
|
- `resource.first_byte.*`、`resource.download.*`、`resource.worker.*`
|
|
@@ -426,7 +426,7 @@ new BkOpenTelemetry({
|
|
|
426
426
|
6. 等待最多 200ms 匹配 Resource Timing,把网络阶段补回同一 Span。
|
|
427
427
|
7. 如已配置 Body 且 Log 开启,异步生成关联原 `trace.id` / `span.id` 的诊断 Log。
|
|
428
428
|
|
|
429
|
-
**产出遥测**:Span `browser.resource`,`span_type=resource`、`resource.type=fetch|xhr`,常用属性包括 `
|
|
429
|
+
**产出遥测**:Span `browser.resource`,`span_type=resource`、`resource.type=fetch|xhr`,常用属性包括 `http.request.method`、`http.response.status_code`、`url.full`、`server.address`、网络阶段与响应体积。
|
|
430
430
|
|
|
431
431
|
```ts
|
|
432
432
|
new BkOpenTelemetry({
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
## 命名规则
|
|
10
10
|
|
|
11
11
|
- **信号名**:`browser.*` 表示内置浏览器事件(如 `browser.web_vital`);`action.<type>`、`custom.<name>` 是运行期动态拼接;`csp.violation`、`websocket.*` 使用领域前缀。
|
|
12
|
-
- **属性 key**:沿用 OpenTelemetry 语义约定的字段用点号(如 `http.request.method`、`exception.type`、`view.id`、`session.id`、`browser.name`);跨类型检索字段使用下划线(如 `span_type`、`result
|
|
12
|
+
- **属性 key**:沿用 OpenTelemetry 语义约定的字段用点号(如 `http.request.method`、`exception.type`、`view.id`、`session.id`、`browser.name`);跨类型检索字段使用下划线(如 `span_type`、`span_subtype`、`result`)。字段常量集中定义在 `src/schema/attributes.ts`。
|
|
13
13
|
|
|
14
14
|
## 公共上下文属性
|
|
15
15
|
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
| `os.name` | string | 操作系统 | 是 |
|
|
36
36
|
| `network.effective_type` | string | 网络质量(`4g` 等) | 是 |
|
|
37
37
|
|
|
38
|
-
> span 还会带上 `span_type` / `span_subtype` / `result` / `error_type`
|
|
38
|
+
> span 还会带上 `span_type` / `span_subtype` / `result` / `error_type` 等归一字段(见下方[归一字段](#归一字段))。接入方可通过 `context.attributes.page` 注入额外的页面属性。
|
|
39
39
|
|
|
40
40
|
## Span 清单
|
|
41
41
|
|
|
42
42
|
| span 名 | span_type | 来源 | 关键属性 | 备注 |
|
|
43
43
|
| --- | --- | --- | --- | --- |
|
|
44
44
|
| `browser.view` | `document` / `route` | View 管理器 | `view.name`、`view.loading_time`、`view.loading_time.source`、`url.previous`、`event.source`、`view.end_reason` | 有持续时间,下一次 View 或 pagehide 时结束 |
|
|
45
|
-
| `browser.resource` | `resource` | Fetch/XHR request 采集 | `resource.type=fetch\|xhr`、`
|
|
46
|
-
| `browser.resource` | `resource` | resource 插件 | `resource.type`、`
|
|
45
|
+
| `browser.resource` | `resource` | Fetch/XHR request 采集 | `resource.type=fetch\|xhr`、`url.full`、`http.request.method`、`http.response.status_code`、网络阶段属性 | span kind 为 CLIENT;Fetch/XHR 共用同一实现 |
|
|
46
|
+
| `browser.resource` | `resource` | resource 插件 | `resource.type`、`url.full`、`resource.size`、网络阶段、`resource.render_blocking_status`、`resource.protocol`、`resource.cache.hit` | 仅静态资源,跳过 Fetch/XHR |
|
|
47
47
|
| `browser.web_vital` | `vital` | webVitals 插件 | `vital.metric`、`vital.value`、`vital.rating`、`vital.id`、`rum.navigation.type`、`vital.<lcp\|cls\|inp\|fcp\|ttfb>.*` | 每个指标一条 |
|
|
48
48
|
| `browser.blank_screen` | `error` | blankScreen 插件(二次确认白屏时) | `blank_screen.empty_ratio`、`blank_screen.reason`、`blank_screen.root_selector`、`blank_screen.root_found`、`blank_screen.*_sample_count`、`blank_screen.center_element` | 每个 View 最多一条 |
|
|
49
49
|
| `browser.error` | `error` | error 插件(`window.error`) | `exception.fingerprint`、`exception.message_short`、`exception.stack_top_frame`、`error.source=window.error`、`error.window_occurrence_index`、`code.filepath`、`code.lineno`、`code.column`、`error.cross_origin` | 完整异常写入标准 `exception` Span Event |
|
|
50
50
|
| `browser.unhandledrejection` | `error` | error 插件(Promise 异常) | `exception.fingerprint`、`error.source=unhandledrejection` | 完整异常写入标准 `exception` Span Event |
|
|
51
51
|
| `browser.resource_error` | `error` | error 插件(资源加载失败) | `exception.fingerprint`、`error.source=resource`、`url.full`、`html.tag` | 完整异常写入标准 `exception` Span Event |
|
|
52
|
-
| `browser.long_task` | `longtask` | longTask 插件 | `long_task.id`、`long_task.entry_type`、`long_task.start_time`、`long_task.duration`、`long_task.blocking_duration`、`long_task.culprit`、`long_task.script.count
|
|
52
|
+
| `browser.long_task` | `longtask` | longTask 插件 | `long_task.id`、`long_task.entry_type`、`long_task.start_time`、`long_task.duration`、`long_task.blocking_duration`、`long_task.culprit`、`long_task.script.count` | LoAF 脚本详情写入 `long_task.script` Span Event |
|
|
53
53
|
| `csp.violation` | `error` | cspViolation 插件 | `csp.blocked_uri`、`csp.violated_directive`、`csp.effective_directive`、`csp.source_file`、`csp.line_number`、`csp.status_code`、`csp.fingerprint`、`csp.window_occurrence_index`、`csp.original_policy`(窗口首条) | |
|
|
54
|
-
| `websocket.connect` | `custom` | websocket 插件(仅建连阶段) | `url.full`、`url.scheme`、`server.address`、`network.protocol.name=websocket
|
|
54
|
+
| `websocket.connect` | `custom` | websocket 插件(仅建连阶段) | `url.full`、`url.scheme`、`server.address`、`network.protocol.name=websocket` | 长连接生命周期不绑定 span |
|
|
55
55
|
| `action.click` / `action.custom` | `action` | action 插件 / `reportAction()` | `action.id/name/type/target.*`、`action.loading_time`、`action.frustration.*`、`action.*.count` | 自动点击或手动动作;挫败信号仅自动点击 |
|
|
56
56
|
| `custom.<name>` | `custom` | `reportCustomEvent()` / 自定义插件 | `rum.custom.name`、业务自定义属性 | 带 `error` 时记录 exception、设置错误 Status/Result,`span_type` 仍为 `custom` |
|
|
57
57
|
|
|
@@ -100,14 +100,6 @@
|
|
|
100
100
|
| `span_subtype` | string | 子类型,如 `fetch`/`xhr`/`js`/`promise`/`lcp` | 是 |
|
|
101
101
|
| `result` | string | `success`/`warning`/`error`/`timeout`/`abort` | 是 |
|
|
102
102
|
| `error_type` | string | 错误细分,如 `http_5xx`/`network_timeout`/`slow`/`none` | 是 |
|
|
103
|
-
| `duration_bucket` | string | `<100ms`/`100~500ms`/`500ms~2s`/`>2s` | 是 |
|
|
104
|
-
| `event_label` | string | 中文事件标签,如 `API 调用`/`错误` | 是 |
|
|
105
|
-
| `target_label` | string | 跨类型主标签,用于统一检索 | 中 |
|
|
106
|
-
| `target_value` | number/string/bool | 主数值(状态码、耗时、字节数等) | 否 |
|
|
107
|
-
| `target_domain` | string | 目标域名 | 中 |
|
|
108
|
-
| `target_path_template` | string | 目标低基数路径模板 | 是 |
|
|
109
|
-
| `status_class` | string | HTTP 状态段,如 `2xx`/`5xx` | 是 |
|
|
110
|
-
| `trace_scene` | string | `page_load` / `route_change` | 是 |
|
|
111
103
|
|
|
112
104
|
### HTTP / Resource
|
|
113
105
|
|
|
@@ -116,11 +108,9 @@
|
|
|
116
108
|
| `http.request.method` | string | 请求方法(大写) |
|
|
117
109
|
| `http.response.status_code` | number | 响应状态码 |
|
|
118
110
|
| `url.full` | string | 完整 URL(已脱敏) |
|
|
111
|
+
| `server.address` | string | 目标主机名 |
|
|
112
|
+
| `server.port` | number | 目标显式端口(存在时) |
|
|
119
113
|
| `resource.type` | string | `fetch`/`xhr` 或静态资源 initiator type |
|
|
120
|
-
| `resource.url` | string | 资源 URL(已脱敏) |
|
|
121
|
-
| `resource.method` | string | 请求方法(Fetch/XHR) |
|
|
122
|
-
| `resource.status_code` | number | 请求状态码(Fetch/XHR) |
|
|
123
|
-
| `resource.duration` | number | 静态资源耗时(ms);请求耗时使用 Span 原生 duration |
|
|
124
114
|
| `resource.redirect.start/duration` | number | 重定向阶段相对开始时间 / 耗时(ms) |
|
|
125
115
|
| `resource.dns.start/duration` | number | DNS 阶段相对开始时间 / 耗时(ms) |
|
|
126
116
|
| `resource.connect.start/duration` | number | TCP 建连阶段相对开始时间 / 耗时(ms) |
|
|
@@ -132,10 +122,8 @@
|
|
|
132
122
|
| `resource.render_blocking_status` | string | `blocking` / `non-blocking` |
|
|
133
123
|
| `resource.size` | number | 传输字节数 |
|
|
134
124
|
| `url.previous` | string | 跳转前 URL |
|
|
135
|
-
| `transfer_size` | number | 传输字节数 |
|
|
136
125
|
| `resource.cache.hit` | boolean | 是否命中缓存 |
|
|
137
126
|
| `resource.protocol` | string | 协议,如 `h2` |
|
|
138
|
-
| `initiator_type` | string | 资源发起类型 |
|
|
139
127
|
| `resource.encoded_body_size` / `resource.decoded_body_size` | number | 资源体积 |
|
|
140
128
|
| `request.body` / `response.body` | string | 仅 `browser.request.body` Log;经过接入方 `redact` 且受长度限制 |
|
|
141
129
|
| `request.body.content_type` / `response.body.content_type` | string | body Content-Type(可获取时) |
|