@blueking/open-telemetry 0.0.30 → 0.0.32
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 +61 -24
- package/dist/bk-rum.global.js +1 -1
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/index.js +368 -357
- package/dist/index.js.map +1 -1
- package/dist/schema/attributes.d.ts +1 -0
- package/package.json +1 -1
- package/skills/bk-rum-otele/references/actions.md +16 -10
- package/skills/bk-rum-otele/references/api.md +5 -2
- package/skills/bk-rum-otele/references/architecture.md +2 -2
- package/skills/bk-rum-otele/references/blank-screen.md +8 -17
- package/skills/bk-rum-otele/references/capabilities.md +2 -2
- package/skills/bk-rum-otele/references/configuration.md +4 -4
- package/skills/bk-rum-otele/references/data-model.md +14 -14
- package/skills/bk-rum-otele/references/errors-security.md +5 -4
- package/skills/bk-rum-otele/references/extensions.md +8 -0
- package/skills/bk-rum-otele/references/framework-integration.md +1 -1
- package/skills/bk-rum-otele/references/getting-started.md +19 -1
- package/skills/bk-rum-otele/references/network.md +22 -19
- package/skills/bk-rum-otele/references/performance.md +12 -23
- package/skills/bk-rum-otele/references/privacy.md +2 -2
- package/skills/bk-rum-otele/references/session-context.md +13 -9
- package/skills/bk-rum-otele/references/span-protocol.md +265 -100
- package/skills/bk-rum-otele/references/telemetry-reference.md +75 -79
- package/skills/bk-rum-otele/references/transport-sampling.md +18 -13
- package/skills/bk-rum-otele/references/troubleshooting.md +1 -1
- package/skills/bk-rum-otele/references/views-routing.md +5 -3
|
@@ -39,7 +39,13 @@ SDK 使用以下固定规则:
|
|
|
39
39
|
|
|
40
40
|
## 跨 Tab 行为
|
|
41
41
|
|
|
42
|
-
默认 storage key
|
|
42
|
+
默认 storage key 按 `application.name` 与 **解析后 Endpoint 的 host** 计算:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
bk_ot_session__${hash36(application.name + "\0" + endpointHost)}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`hash36` 是 djb2 风格非密码学 hash,转成 36 进制。同一浏览器 origin 下,不同 `application.name` 或不同 Collector host 不会共用 Session。多个同源 Tab 默认共享同一 key 下的 Session Record。
|
|
43
49
|
|
|
44
50
|
- 其他 Tab 只延长当前相同 Session 时,本 Tab 会更新自己的过期 Timer。
|
|
45
51
|
- 其他 Tab 使 Session 过期或替换 ID 时,本 Tab 会停用自己的 Session。
|
|
@@ -75,22 +81,21 @@ new BkOpenTelemetry({
|
|
|
75
81
|
|
|
76
82
|
Span 名固定为 `browser.session`:
|
|
77
83
|
|
|
78
|
-
| `session.phase` | 使用时机 |
|
|
84
|
+
| `session.phase` | 使用时机 | 内部 lifecycle reason(不上报为 Attribute) |
|
|
79
85
|
| --- | --- | --- |
|
|
80
86
|
| `start` | 首次创建 | `init` |
|
|
81
87
|
| `rotate` | 旧 Session 过期后新建 | `inactivity`、`maxLifetime` |
|
|
82
88
|
| `end` | 当前 Session 失效 | `inactivity`、`maxLifetime`、`external` |
|
|
83
89
|
|
|
84
|
-
|
|
90
|
+
实际上报字段只有:
|
|
85
91
|
|
|
86
92
|
- `session.id`
|
|
87
|
-
- `session.start_time`
|
|
88
93
|
- `session.type=user`
|
|
89
94
|
- `session.has_replay=false`
|
|
90
|
-
- `session.lifecycle.reason`
|
|
91
|
-
- `session.previous_id`,仅存在前一个 ID 时出现
|
|
92
95
|
- `session.phase`
|
|
93
96
|
|
|
97
|
+
过期原因通过 `onSessionLifecycle` 通知插件,**不会**写成 `session.lifecycle.reason` 或 `session.start_time`。完整字段见[遥测字段字典](./telemetry-reference.md#session-字段)。
|
|
98
|
+
|
|
94
99
|
生命周期 Span 是瞬时事件,持续时间由服务端根据时间戳推导。
|
|
95
100
|
|
|
96
101
|
## User 上下文
|
|
@@ -121,10 +126,9 @@ SDK 只维护 `user.id`,并原样透传:不 hash、不截断、不验证、
|
|
|
121
126
|
| `user_agent.name` | UA 简单识别:Edge/Chrome/Firefox/Safari/Other | 否 |
|
|
122
127
|
| `user_agent.version` | UA 主版本 | 未识别版本时 |
|
|
123
128
|
| `user_agent.os.name` | UA / UA-CH platform | 否,无法识别为 `Other` |
|
|
124
|
-
| `device.type` | UA-CH mobile 或移动 UA |
|
|
125
|
-
| `device.memory_gib` | `navigator.deviceMemory` | 浏览器未实现时 |
|
|
129
|
+
| `device.type` | UA-CH mobile 或移动 UA 特征 | 否,仅为 `mobile` 或 `desktop` |
|
|
126
130
|
|
|
127
|
-
关闭 `tracking.device` 时,这些 Device Resource
|
|
131
|
+
关闭 `tracking.device` 时,这些 Device Resource 字段不写入。当前不读取 `navigator.deviceMemory`,因此没有 `device.memory_gib`。
|
|
128
132
|
|
|
129
133
|
## Device 运行时属性
|
|
130
134
|
|