@blueking/open-telemetry 0.0.12 → 0.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/open-telemetry",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "OpenTelemetry browser SDK for BK RUM",
5
5
  "author": "TencentCloud Real User Monitoring",
6
6
  "main": "dist/index.js",
@@ -88,7 +88,7 @@ CDN:
88
88
  </script>
89
89
  ```
90
90
 
91
- `transport.endpoint` 填 collector 根地址即可,SDK 自动拼 `/v1/traces`、`/v1/metrics`、`/v1/logs`;`token` 作为 `Authorization: Bearer <token>` 默认头。构造后默认 `autoStart: true` 自动启动,无需手动 `start()`。
91
+ `transport.endpoint` 填上报根地址(不含路径前缀),SDK 自动拼 `/v1/rum`、`/v1/metrics`、`/v1/logs`;若通过 `transport.signals.endpoints` 或单信号 `endpoint` 自定义了某一类地址,则该信号使用自定义 URL,不再拼接。`token` 作为 `Authorization: Bearer <token>` 默认头。构造后默认 `autoStart: true` 自动启动,无需手动 `start()`。
92
92
 
93
93
  ## 默认采集能力清单
94
94
 
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "id": 1,
14
14
  "name": "local-no-data-troubleshoot",
15
- "prompt": "我按文档接了 bk-rum,本地起了 collector 在 4318,但 Network 里没看到 /v1/traces 请求,reportCustomEvent 也没上报,debug 我也开了。可能是什么问题?怎么排查?",
15
+ "prompt": "我按文档接了 bk-rum,本地起了 collector 在 4318,但 Network 里没看到 /rum 请求,reportCustomEvent 也没上报,debug 我也开了。可能是什么问题?怎么排查?",
16
16
  "expected_output": "排障应覆盖:sampling.rate 是会话级 sticky 采样、未命中时插件不启动且手动事件静默丢弃(建议调试设 rate:1);enabled 是否为 false;建议 spanProcessor:'simple' 便于本地看数据;检查 collector 是否监听 4318、endpoint 是否正确。",
17
17
  "files": [],
18
18
  "assertions": []
@@ -185,7 +185,7 @@ new BkOpenTelemetry({
185
185
 
186
186
  # 上报与采样
187
187
 
188
- SDK 使用 OTLP HTTP exporter 分别上报 traces、metrics、logs。默认 endpoint 是 `http://localhost:4318`,会自动拼接 `/v1/traces`、`/v1/metrics`、`/v1/logs`。
188
+ SDK 使用 OTLP HTTP exporter 分别上报 traces、metrics、logs。默认 endpoint 是 `http://localhost:4318`,会自动拼接 `/v1/rum`、`/v1/metrics`、`/v1/logs`。
189
189
 
190
190
  ## 统一 endpoint
191
191
 
@@ -200,7 +200,7 @@ new BkOpenTelemetry({
200
200
 
201
201
  实际使用的上报地址为:
202
202
 
203
- - traces:`https://rum-collector.example.com/v1/traces`
203
+ - traces:`https://rum-collector.example.com/v1/rum`
204
204
  - metrics:`https://rum-collector.example.com/v1/metrics`
205
205
  - logs:`https://rum-collector.example.com/v1/logs`
206
206
 
@@ -217,7 +217,7 @@ new BkOpenTelemetry({
217
217
  },
218
218
  signals: {
219
219
  endpoints: {
220
- traces: 'https://trace-gateway.example.com/v1/traces',
220
+ traces: 'https://trace-gateway.example.com/v1/rum',
221
221
  metrics: 'https://metric-gateway.example.com/v1/metrics',
222
222
  logs: 'https://log-gateway.example.com/v1/logs',
223
223
  },
@@ -235,6 +235,8 @@ new BkOpenTelemetry({
235
235
  });
236
236
  ```
237
237
 
238
+ 自定义的 `signals.endpoints.*`(或单信号 `endpoint`)会原样使用,不再基于外层 `endpoint` 拼接 `/v1/...`。
239
+
238
240
  `transport.token` 会生成默认 `Authorization: Bearer <token>`,显式配置的 `headers` 会继续合并进去。
239
241
 
240
242
  ## 避免自循环采集
@@ -24,7 +24,7 @@ new BkOpenTelemetry({
24
24
  检查点:
25
25
 
26
26
  - Collector 是否监听 `4318`。
27
- - 浏览器 Network 中是否有 `/v1/traces`、`/v1/metrics`、`/v1/logs` 请求。
27
+ - 浏览器 Network 中是否有 `/v1/rum`、`/v1/metrics`、`/v1/logs` 请求。
28
28
  - 是否被采样丢弃。
29
29
  - `enabled` 是否为 `false`。
30
30
 
@@ -206,7 +206,7 @@ new BkOpenTelemetry({
206
206
  transport: {
207
207
  signals: {
208
208
  endpoints: {
209
- traces: 'https://trace-gateway.example.com/v1/traces',
209
+ traces: 'https://trace-gateway.example.com/v1/rum',
210
210
  metrics: 'https://metric-gateway.example.com/v1/metrics',
211
211
  logs: 'https://log-gateway.example.com/v1/logs',
212
212
  },