@blueking/open-telemetry 0.0.32 → 0.0.33
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 +20 -19
- package/dist/bk-rum.global.js +2 -2
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/core/plugin.d.ts +3 -0
- package/dist/index.js +461 -354
- package/dist/index.js.map +1 -1
- package/dist/plugins/web-vitals.d.ts +1 -1
- package/dist/schema/attributes.d.ts +1 -0
- package/dist/schema/span.d.ts +10 -0
- 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/actions.md +3 -3
- package/skills/bk-rum-otele/references/api.md +3 -3
- package/skills/bk-rum-otele/references/architecture.md +2 -2
- package/skills/bk-rum-otele/references/blank-screen.md +2 -2
- package/skills/bk-rum-otele/references/capabilities.md +17 -17
- package/skills/bk-rum-otele/references/configuration.md +1 -1
- package/skills/bk-rum-otele/references/data-model.md +3 -3
- package/skills/bk-rum-otele/references/errors-security.md +4 -4
- package/skills/bk-rum-otele/references/getting-started.md +3 -2
- package/skills/bk-rum-otele/references/network.md +5 -5
- package/skills/bk-rum-otele/references/performance.md +2 -2
- package/skills/bk-rum-otele/references/session-context.md +3 -3
- package/skills/bk-rum-otele/references/span-protocol.md +174 -265
- package/skills/bk-rum-otele/references/telemetry-reference.md +36 -33
- 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 +4 -4
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ ESM 构建把 OpenTelemetry 依赖保留为外部 package dependencies,由应
|
|
|
47
47
|
无构建流程的页面可以用全局包,依赖已打进 bundle:
|
|
48
48
|
|
|
49
49
|
```html
|
|
50
|
-
<script src="https://unpkg.com/@blueking/open-telemetry@0.0.
|
|
50
|
+
<script src="https://unpkg.com/@blueking/open-telemetry@0.0.32/dist/bk-rum.global.js"></script>
|
|
51
51
|
<script>
|
|
52
52
|
window.rum = new window.BkOpenTelemetry({
|
|
53
53
|
application: { name: 'legacy-portal', environment: 'production' },
|
|
@@ -64,19 +64,19 @@ CDN 入口只暴露 `window.BkOpenTelemetry` 这一个构造函数,不提供 `
|
|
|
64
64
|
|
|
65
65
|
| 能力 | 默认 | 浏览器来源 | 主要产出 |
|
|
66
66
|
| --- | --- | --- | --- |
|
|
67
|
-
| Session | 基础能力 | localStorage、用户活动、visibility | `
|
|
68
|
-
| View / Router | auto | Navigation Timing、History、hash、BFCache |
|
|
67
|
+
| Session | 基础能力 | localStorage、用户活动、visibility | `session.start` / `session.rotate` / `session.end` |
|
|
68
|
+
| View / Router | auto | Navigation Timing、History、hash、BFCache | `<view.name>` start/update/end |
|
|
69
69
|
| View Loading Time | 开 | 请求、DOM、资源、`window.open` activity | `view.loading_time` |
|
|
70
|
-
| Fetch/XHR | 开 | fetch、XMLHttpRequest、Resource Timing |
|
|
71
|
-
| 静态资源 | 开 | Resource PerformanceObserver | `
|
|
70
|
+
| Fetch/XHR | 开 | fetch、XMLHttpRequest、Resource Timing | `<METHOD> <url.template>` CLIENT |
|
|
71
|
+
| 静态资源 | 开 | Resource PerformanceObserver | `GET <url.template>` CLIENT |
|
|
72
72
|
| Error | 开 | error、unhandledrejection、资源加载错误 | 三类 Error Span + exception event |
|
|
73
73
|
| Web Vitals | 开 | web-vitals / PerformanceObserver | CLS/FCP/INP/LCP/TTFB Span |
|
|
74
|
-
| Action | 开 | 主键 click 与 activity | `action.
|
|
75
|
-
| Blank Screen | 开 | 页面稳定 + DOM 九点采样 | `
|
|
74
|
+
| Action | 开 | 主键 click 与 activity | `action.name`、挫败信号 |
|
|
75
|
+
| Blank Screen | 开 | 页面稳定 + DOM 九点采样 | `blank_screen.<reason>` |
|
|
76
76
|
| Device | 开 | UA/UA-CH、Screen、Network Information | Resource 与运行时属性 |
|
|
77
|
-
| Long Task | 关 | Long Animation Frame / Long Tasks | `
|
|
78
|
-
| WebSocket | 关 | WebSocket 生命周期 |
|
|
79
|
-
| CSP | 关 | securitypolicyviolation | `csp
|
|
77
|
+
| Long Task | 关 | Long Animation Frame / Long Tasks | `long_task.entry_type` |
|
|
78
|
+
| WebSocket | 关 | WebSocket 生命周期 | `websocket.<phase>` |
|
|
79
|
+
| CSP | 关 | securitypolicyviolation | `csp.<effective_directive>` |
|
|
80
80
|
|
|
81
81
|
Session 和 View 是普通 Span 的必要关联边界,不能通过一个 `tracking.session: false` 关闭。精确默认值、降级行为和成本见[能力矩阵](./wikis/capabilities.md)。
|
|
82
82
|
|
|
@@ -183,7 +183,7 @@ session: {
|
|
|
183
183
|
- 同一 Session 的决定一致,轮换后重新计算;
|
|
184
184
|
- 未采样时 `startSpan()` 返回 non-recording Span,手动事件不导出;
|
|
185
185
|
- 普通 Span 还必须有有效 `session.id` 与 `view.id`;
|
|
186
|
-
- `
|
|
186
|
+
- `span_type=session` 是允许没有 View 的例外;
|
|
187
187
|
- SDK 自身 `/v1/rum` 请求、显式 discard 和 beforeSend 返回 false 的 Span 会被过滤。
|
|
188
188
|
|
|
189
189
|
## 手动事件
|
|
@@ -205,7 +205,7 @@ rum.reportCustomEvent({
|
|
|
205
205
|
});
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
- `reportAction()` 立即创建并结束
|
|
208
|
+
- `reportAction()` 立即创建并结束 `<action.name>`(上例为 `submit-order`,`action.type=custom`),不是持续关联后续请求的自动 Action;
|
|
209
209
|
- `reportCustomEvent()` 创建 `custom.<name>`;带 Error 时记录 exception 和 ERROR status;
|
|
210
210
|
- name 是检索维度,必须有限枚举,不能拼用户/订单/随机 ID;
|
|
211
211
|
- 两者都受当前 Session 采样约束。
|
|
@@ -313,14 +313,14 @@ OTLP 字段分五层:
|
|
|
313
313
|
|
|
314
314
|
| Span | 领域字段 |
|
|
315
315
|
| --- | --- |
|
|
316
|
-
| `
|
|
317
|
-
|
|
|
318
|
-
|
|
|
316
|
+
| `session.<phase>` | `session.phase`、`session.id`、`session.type`、`session.has_replay` |
|
|
317
|
+
| `<view.name>` | `view.phase`、`view.version`、`view.url` / `url_template` / `previous*`、`loading_type`、`loading_time` / `loading_time_source`、初始导航 timing、`view.end_reason` |
|
|
318
|
+
| `<method> <url.template>` | `url.full` / `url.template`、`http.request.method` / `response.status_code`、`resource.type` / `size` / `protocol` / `cache.hit`、DNS/TCP/TLS/首字节/下载阶段 |
|
|
319
319
|
| Error Span | `error.message` / `source` / `handled`、`code.filepath` / `lineno` / `column`、`exception` Event |
|
|
320
|
-
|
|
|
321
|
-
| `
|
|
322
|
-
| `
|
|
323
|
-
|
|
|
320
|
+
| `<VITAL_METRIC>` | `vital.metric` / `value` / `id`,以及 LCP/INP/TTFB 的部分 attribution |
|
|
321
|
+
| `click <target>` | `action.id` / `name` / `type` / `target.name` / `target.tag` / `frustration.type` |
|
|
322
|
+
| `blank_screen.<reason>` | `blank_screen.reason` / `empty_ratio` / `empty_sample_count` |
|
|
323
|
+
| `<long_task.entry_type>` | `long_task.id` / `entry_type` / `name`,LoAF 的 `blocking_duration` 等,加 script/attribution Event |
|
|
324
324
|
|
|
325
325
|
持续时间统一用 Span 起止时间表达,没有 `action.loading_time`、`long_task.duration` 这类耗时 Attribute。完整层级见[RUM 数据模型](./wikis/concepts/data-model.md),逐字段定义和「当前不会出现的字段」清单见[遥测字段字典](./wikis/reference/telemetry.md)。
|
|
326
326
|
|
|
@@ -358,6 +358,7 @@ await rum.flush();
|
|
|
358
358
|
| 任务 | 文档 |
|
|
359
359
|
| --- | --- |
|
|
360
360
|
| 首次安装和验证 | [快速上手](./wikis/getting-started.md) |
|
|
361
|
+
| 用 AI 安装 Skill 并生成配置 | [用 AI 接入](./wikis/ai-setup.md) |
|
|
361
362
|
| 上线检查和容量/隐私/CORS | [生产接入指南](./wikis/production.md) |
|
|
362
363
|
| 判断支持范围、默认开关和降级 | [能力矩阵](./wikis/capabilities.md) |
|
|
363
364
|
| Vue/React/Router/SSR/微前端 | [框架与路由集成](./wikis/framework-integration.md) |
|