@deepseek-ai/dsh-session-telemetry-otel 0.1.1-rc.2 → 0.1.2-alpha.2
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.i18n.yaml +2 -2
- package/README.md +109 -19
- package/README.zh.md +110 -20
- package/package.json +25 -17
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/session/session-telemetry-otel/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 8aa215f5fd2e1344911e3f069f038a4f89f6fa3f
|
|
6
|
+
README.zh.md: 1bb3aa8f3b3e4b2f50e66e1833a8f4ab00112a8b
|
package/README.md
CHANGED
|
@@ -1,14 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "OpenTelemetry session-telemetry backend for deployments choosing a mode, configuring the exporter, or tracing what leaves the machine."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# @deepseek-ai/dsh-session-telemetry-otel
|
|
2
7
|
|
|
3
8
|
English | [中文](README.zh.md)
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
`dsh-session-telemetry-otel` delivers session records through OpenTelemetry logs and is the only entry a deployment loads for the [session-telemetry seam](../session-telemetry/README.md). Its `mode` decides whether session records follow the live stream, are released only at recorded feedback, or stay local: `FULL` hands every record to the OTel SDK immediately, `FEEDBACK_ONLY` replays the canonical log when a `feedback/record` lands, and `DISABLED` (the default) constructs nothing and shares nothing. Uploading modes compose the OTel JS SDK as-is — `LoggerProvider` → `BatchLogRecordProcessor` → OTLP/HTTP log exporter — and map each record onto `logger.emit()`, so batching, retry, queueing, and loss policy follow the SDK. Records carry the complete event data as the seam's redaction waterfall returns it, so a deployment exporting beyond a trusted boundary mounts its own redaction rules. Modes, configuration, and the export surface come first; the implementation internals live in a collapsible developer section below.
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Use this package](#use-this-package)
|
|
17
|
+
- [Understand the implementation](#understand-the-implementation)
|
|
18
|
+
- [Further Exploration](#further-exploration)
|
|
19
|
+
- [Model Experience](#model-experience)
|
|
20
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
21
|
+
- [Dev Note](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## Use this package
|
|
27
|
+
|
|
28
|
+
Mount this plugin when a deployment should export session records through OpenTelemetry logs. Choose a mode, give the exporter an endpoint, and decide whether to mount redaction rules on the seam.
|
|
29
|
+
|
|
30
|
+
### Modes
|
|
31
|
+
|
|
32
|
+
| `mode` | Behavior |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `FULL` | Every projected record, including lifecycle ops records, is handed to the OTel SDK immediately |
|
|
35
|
+
| `FEEDBACK_ONLY` | Each `feedback/record` replays, projects, and redacts the canonical session-log suffix through that event; later records wait for another feedback event and remain local if none arrives |
|
|
36
|
+
| `DISABLED` | Default. No coordinator, provider, processor, or exporter is constructed; no telemetry record leaves the process, and a `feedback/record` logs that nothing will be shared |
|
|
37
|
+
|
|
38
|
+
Programmatic TypeScript configuration uses the exported `SessionTelemetryMode` enum; raw string literals are not assignable. The mounted service discloses the resolved mode through the seam's [`SessionTelemetrySharingStatus`](../session-telemetry/README.md#the-sharing-disclosure) `sharing` property (`full` / `feedback-only` / `disabled`), so the `/feedback` acknowledgement reports whether and how the session is shared — even `DISABLED` discloses `disabled`.
|
|
6
39
|
|
|
7
|
-
|
|
40
|
+
### Minimal configuration
|
|
41
|
+
|
|
42
|
+
Uploading modes require an exporter URL and accept the SDK option blocks verbatim:
|
|
8
43
|
|
|
9
44
|
```yaml
|
|
10
45
|
- id: sessionTelemetry-otel
|
|
11
|
-
name: '@deepseek-ai/dsh-session-
|
|
46
|
+
name: '@deepseek-ai/dsh-session-telemetry-otel'
|
|
12
47
|
config:
|
|
13
48
|
mode: FULL # explicit opt-in; default: DISABLED
|
|
14
49
|
shutdownTimeoutMillis: 3000 # optional; defaults to 3000
|
|
@@ -19,38 +54,93 @@ The OpenTelemetry backend for [the telemetry seam](../session-telemetry/) — th
|
|
|
19
54
|
processor: {} # optional; passed verbatim to BatchLogRecordProcessor
|
|
20
55
|
```
|
|
21
56
|
|
|
22
|
-
|
|
|
57
|
+
| Field | Default | Meaning |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| `mode` | `DISABLED` | Sharing policy: `FULL`, `FEEDBACK_ONLY`, or `DISABLED` |
|
|
60
|
+
| `exporter.url` | required in uploading modes | Full OTLP logs endpoint; must parse as `http(s)` |
|
|
61
|
+
| `exporter`, `processor` | — | Passed verbatim to the SDK exporter and batch processor |
|
|
62
|
+
| `shutdownTimeoutMillis` | `3,000` | Outer deadline for the SDK's complete shutdown sequence |
|
|
63
|
+
|
|
64
|
+
The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-session-telemetry-otel) is the exhaustive source for every accepted field. Upload authorization is positive and fail-closed: an unknown direct-construction mode fails before transport configuration is read, only `FULL` accepts direct `ctx.sessionTelemetry.emit()` calls, and `FEEDBACK_ONLY` treats only the exact `feedback/record` object already stored in the canonical log as consent.
|
|
65
|
+
|
|
66
|
+
### What leaves the machine
|
|
67
|
+
|
|
68
|
+
In uploading modes, records carry the complete `event.data` as the seam's `sessionTelemetry/record` waterfall returns it — message content, tool arguments and results, the system prompt and tool schemas, todo text, compaction summaries, feedback text, and the session `cwd`. Provider credentials never appear: adapter API keys are constructor parameters, not session events, so they are structurally absent from the log and therefore from telemetry. `DISABLED` constructs no SDK pipeline and hands no capture to a backend.
|
|
69
|
+
|
|
70
|
+
### Failures and shutdown
|
|
71
|
+
|
|
72
|
+
Misconfiguration fails at plugin load: a missing or non-`http(s)` `exporter.url`, a non-positive-integer `processor.maxExportBatchSize` (which the SDK accepts but then hangs on at shutdown), and an invalid `shutdownTimeoutMillis` all reject before any record is exported. During shutdown, OTel awaits `exporter.forceFlush()` before the processor's bounded completion promise; if that transport promise never settles, this package abandons the wait at `shutdownTimeoutMillis`, logs the contained failure, and lets application teardown continue — records still pending then may be lost at process exit.
|
|
73
|
+
|
|
74
|
+
-----
|
|
75
|
+
|
|
76
|
+
<a id="understand-the-implementation"></a>
|
|
77
|
+
## Understand the implementation
|
|
78
|
+
|
|
79
|
+
<details>
|
|
80
|
+
<summary>Implementation internals — click to expand</summary>
|
|
81
|
+
|
|
82
|
+
This section explains the backend's composition; the observable behavior is fully covered in [Use this package](#use-this-package).
|
|
83
|
+
|
|
84
|
+
### Design concept
|
|
85
|
+
|
|
86
|
+
The backend is a thin adapter over the OTel JS SDK: it owns capture mode, resource identity, and an outer shutdown deadline, and passes everything else through verbatim. Two instrumentation scopes separate record channels — ledger records on `@deepseek-ai/dsh-session-telemetry-otel`, operational records on `@deepseek-ai/dsh-session-telemetry-otel/ops` — so receivers can alert on ops without summing them. Resource identity carries `service.name`/`service.version` from `dsh-llm`'s `APP_IDENTITY` plus the package's anonymous `user.id` (from `$DSH_HOME/.anonymous-user-id`), once per export batch rather than per record.
|
|
87
|
+
|
|
88
|
+
### Source map
|
|
89
|
+
|
|
90
|
+
| File | Role |
|
|
23
91
|
|---|---|
|
|
24
|
-
| `
|
|
25
|
-
| `FEEDBACK_ONLY` | Each `feedback/record` replays, projects, and redacts the canonical session-log suffix through that event. Later records wait for another feedback event and remain local if none arrives. |
|
|
26
|
-
| `DISABLED` | Default. No coordinator, provider, processor, or exporter is constructed. No telemetry record leaves the process. A `feedback/record` logs `session sessionTelemetry is DISABLED; nothing will be shared and this feedback remains local`; the event remains in the local session log. |
|
|
92
|
+
| [`src/index.ts`](src/index.ts) | Plugin entry: mode resolution, fail-closed validation, SDK pipeline wiring, coordinator composition, shutdown deadline |
|
|
27
93
|
|
|
28
|
-
|
|
94
|
+
### Capture wiring
|
|
29
95
|
|
|
30
|
-
|
|
96
|
+
`FULL` composes the coordinator in `live` mode and lets direct service calls through; `FEEDBACK_ONLY` composes it in `on-demand` mode, gives the coordinator a private backend capability, and triggers `captureSession(session, event.seq)` only for the exact canonical feedback record; `DISABLED` registers nothing but a warning on `feedback/record`. The backend deliberately implements no `flush()`: the batch processor owns ordinary flushing, and forwarding the hint to `forceFlush()` would create the sole source of concurrent flushes whose interaction with shutdown's drain is undocumented.
|
|
31
97
|
|
|
32
|
-
|
|
98
|
+
### Field mapping
|
|
33
99
|
|
|
34
|
-
|
|
100
|
+
Each seam record maps onto one SDK log record: `time` and `severity` become the SDK timestamp and severity fields, and `body` and `attributes` carry through verbatim; the exact field mapping lives in [`src/index.ts`](src/index.ts). In `FULL`, receivers can detect crashes by `shutdown`-record absence — the marker is emitted at the session's own disposal or application teardown, and a marker followed by more events is a telemetry reload. In `FEEDBACK_ONLY`, a released prefix normally has no later `shutdown` marker, so its absence is not a crash signal.
|
|
35
101
|
|
|
36
|
-
|
|
102
|
+
</details>
|
|
37
103
|
|
|
38
|
-
|
|
104
|
+
-----
|
|
39
105
|
|
|
40
|
-
|
|
106
|
+
<a id="further-exploration"></a>
|
|
107
|
+
## Further Exploration
|
|
41
108
|
|
|
42
|
-
|
|
109
|
+
Read these pages when the backend contract is not enough. They move from the seam it implements to the subsystem reference and the identity it reports.
|
|
43
110
|
|
|
111
|
+
- [Session telemetry seam](../session-telemetry/README.md) — the capture contract, record vocabulary, and redaction waterfall.
|
|
112
|
+
- [Session telemetry subsystem](../../../docs/subsystems/session-telemetry.md) — the capability split and type declarations.
|
|
113
|
+
- [Anonymous user identity](../../identity/anonymous-user-id/README.md) — the id reported as the OTel Resource `user.id`.
|
|
114
|
+
- [Generated configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-session-telemetry-otel) — every accepted config field and its source declaration.
|
|
115
|
+
|
|
116
|
+
-----
|
|
117
|
+
|
|
118
|
+
<a id="model-experience"></a>
|
|
44
119
|
## Model Experience
|
|
45
120
|
|
|
46
|
-
None, as the backend
|
|
121
|
+
None, as the backend forwards seam records into the OTel SDK pipeline and registers nothing model-facing.
|
|
47
122
|
|
|
48
123
|
#### KV Cache effect
|
|
49
124
|
|
|
50
|
-
None;
|
|
125
|
+
None; the package neither assembles nor sends a provider request.
|
|
51
126
|
|
|
52
127
|
## Known Limitations and Deferred Work
|
|
53
128
|
|
|
54
|
-
|
|
129
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
These limits define where SDK behavior governs and where export guarantees end. They are current package constraints.
|
|
133
|
+
|
|
134
|
+
- **Upstream experimental tree** — `@opentelemetry/sdk-logs` is published from the upstream experimental tree; SDK API churn lands here and only here, while the seam contract does not move.
|
|
55
135
|
- **Live-collector behavior belongs to the SDK exporter** — authentication, TLS, throttling, and other real OTLP deployment behavior follow the upstream SDK rather than a package-owned compatibility layer.
|
|
56
|
-
- **Feedback-time snapshot** — `FEEDBACK_ONLY` retains no telemetry-owned copy before feedback
|
|
136
|
+
- **Feedback-time snapshot** — `FEEDBACK_ONLY` retains no telemetry-owned copy before feedback; it reads and redacts the current canonical log when feedback is recorded, so a crash before feedback uploads nothing and policy changes before feedback affect what that replay exports.
|
|
137
|
+
|
|
138
|
+
<a id="dev-note"></a>
|
|
139
|
+
### Dev Note
|
|
140
|
+
|
|
141
|
+
<details>
|
|
142
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
143
|
+
|
|
144
|
+
None.
|
|
145
|
+
|
|
146
|
+
</details>
|
package/README.zh.md
CHANGED
|
@@ -1,14 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "面向部署方的 OpenTelemetry 会话遥测后端说明,用于选择模式、配置导出器或排查哪些数据离开本机。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# @deepseek-ai/dsh-session-telemetry-otel
|
|
2
7
|
|
|
3
8
|
[English](README.md) | 中文
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
`dsh-session-telemetry-otel` 通过 OpenTelemetry 日志投递会话记录,是[会话遥测 seam](../session-telemetry/README.zh.md) 的后端,也是部署方唯一要加载的条目。其 `mode` 决定会话记录是跟随实时流、仅在记录反馈时释放,还是留在本地:`FULL` 把每条记录立即交给 OTel SDK,`FEEDBACK_ONLY` 在 `feedback/record` 落地时回放权威日志,`DISABLED`(默认值)不构造任何内容也不共享任何内容。上传模式会原样组合 OTel JS SDK——`LoggerProvider` → `BatchLogRecordProcessor` → OTLP/HTTP 日志导出器——并把每条记录映射到 `logger.emit()`,因此批处理、重试、排队与丢失策略都遵循 SDK。记录携带 seam 脱敏 waterfall(瀑布式事件)返回的完整事件数据,因此向可信边界之外导出的部署方要挂载自己的脱敏规则。模式、配置与导出面在前;实现内部细节放在下方可折叠的开发者章节中。
|
|
13
|
+
|
|
14
|
+
## 目录
|
|
15
|
+
|
|
16
|
+
- [使用本包](#use-this-package)
|
|
17
|
+
- [理解实现](#understand-the-implementation)
|
|
18
|
+
- [进一步探索](#further-exploration)
|
|
19
|
+
- [模型体验](#model-experience)
|
|
20
|
+
- [已知限制与延期工作](#known-limitations-and-deferred-work)
|
|
21
|
+
- [开发备注](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## 使用本包
|
|
27
|
+
|
|
28
|
+
当部署方需要通过 OpenTelemetry 日志导出会话记录时挂载此插件。选择一个模式、给导出器一个端点,并决定是否在 seam 上挂载脱敏规则。
|
|
29
|
+
|
|
30
|
+
### 模式
|
|
31
|
+
|
|
32
|
+
| `mode` | 行为 |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `FULL` | 每条已投影记录都立即交给 OTel SDK,包括生命周期运维记录 |
|
|
35
|
+
| `FEEDBACK_ONLY` | 每个 `feedback/record` 都会回放权威会话日志中截至该事件的后缀,并进行投影与脱敏;后续记录等待下一个反馈事件;如果没有后续反馈,则留在本地 |
|
|
36
|
+
| `DISABLED` | 默认值。不构造协调器、提供方、处理器或导出器;没有遥测记录会离开进程,`feedback/record` 会记录「不会共享任何内容」 |
|
|
37
|
+
|
|
38
|
+
程序化 TypeScript 配置使用导出的 `SessionTelemetryMode` 枚举;原始字符串字面量不可赋值。已挂载服务通过 seam 的 [`SessionTelemetrySharingStatus`](../session-telemetry/README.zh.md#the-sharing-disclosure) `sharing` 属性披露解析后的模式(`full` / `feedback-only` / `disabled`),因此 `/feedback` 的确认文本可以报告会话是否以及如何被共享——即使 `DISABLED` 也会披露 `disabled`。
|
|
6
39
|
|
|
7
|
-
|
|
40
|
+
### 最小配置
|
|
41
|
+
|
|
42
|
+
上传模式需要导出器 URL,并原样接受 SDK 选项块:
|
|
8
43
|
|
|
9
44
|
```yaml
|
|
10
45
|
- id: sessionTelemetry-otel
|
|
11
|
-
name: '@deepseek-ai/dsh-session-
|
|
46
|
+
name: '@deepseek-ai/dsh-session-telemetry-otel'
|
|
12
47
|
config:
|
|
13
48
|
mode: FULL # explicit opt-in; default: DISABLED
|
|
14
49
|
shutdownTimeoutMillis: 3000 # optional; defaults to 3000
|
|
@@ -19,38 +54,93 @@
|
|
|
19
54
|
processor: {} # optional; passed verbatim to BatchLogRecordProcessor
|
|
20
55
|
```
|
|
21
56
|
|
|
22
|
-
|
|
|
57
|
+
| 字段 | 默认值 | 含义 |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| `mode` | `DISABLED` | 共享策略:`FULL`、`FEEDBACK_ONLY` 或 `DISABLED` |
|
|
60
|
+
| `exporter.url` | 上传模式必填 | 完整 OTLP 日志端点;必须能解析为 `http(s)` |
|
|
61
|
+
| `exporter`、`processor` | — | 原样传给 SDK 导出器与批处理器 |
|
|
62
|
+
| `shutdownTimeoutMillis` | `3,000` | SDK 完整关闭序列的外层截止时间 |
|
|
63
|
+
|
|
64
|
+
生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-session-telemetry-otel)是每个受支持字段的穷尽式真源。上传授权采用显式许可,且为 fail-closed:通过直接构造传入未知模式时会在读取传输配置前失败,只有 `FULL` 接受对 `ctx.sessionTelemetry.emit()` 的直接调用,`FEEDBACK_ONLY` 只把权威日志中已存储的精确 `feedback/record` 对象视为同意。
|
|
65
|
+
|
|
66
|
+
### 哪些数据会离开本机
|
|
67
|
+
|
|
68
|
+
在上传模式中,记录携带 seam 的 `sessionTelemetry/record` waterfall 返回的完整 `event.data`——消息内容、工具参数与结果、系统提示词与工具 schema、todo 文本、压缩(compaction)摘要、反馈文本,以及会话 `cwd`。提供方凭据绝不会出现:适配器的 API key 是构造函数参数而非会话事件,因此它们在结构上就不存在于日志中,也就不存在于遥测中。`DISABLED` 不构造 SDK 流水线,也不把任何捕获内容交给后端。
|
|
69
|
+
|
|
70
|
+
### 失败与关闭
|
|
71
|
+
|
|
72
|
+
配置错误会在插件加载时失败:缺少或非 `http(s)` 的 `exporter.url`、非正整数的 `processor.maxExportBatchSize`(SDK 会接受该值,随后却在关闭时挂起)以及无效的 `shutdownTimeoutMillis` 都会在任何记录导出前被拒绝。关闭期间,OTel 会先等待 `exporter.forceFlush()`,再等待处理器有界完成 promise;如果该传输 promise 始终不结算,本包会在 `shutdownTimeoutMillis` 到期时放弃等待、记录已隔离的失败,并让应用继续拆卸——届时仍待处理的记录可能在进程退出时丢失。
|
|
73
|
+
|
|
74
|
+
-----
|
|
75
|
+
|
|
76
|
+
<a id="understand-the-implementation"></a>
|
|
77
|
+
## 理解实现
|
|
78
|
+
|
|
79
|
+
<details>
|
|
80
|
+
<summary>实现细节——点击展开</summary>
|
|
81
|
+
|
|
82
|
+
本节解释后端的组合方式;可观察行为已在[使用本包](#use-this-package)中完整说明。
|
|
83
|
+
|
|
84
|
+
### 设计理念
|
|
85
|
+
|
|
86
|
+
后端是对 OTel JS SDK 的薄适配层:它拥有捕获模式、资源身份与一个外层关闭截止时间,其余全部原样透传。两个插桩作用域区分记录通道——ledger 记录挂在 `@deepseek-ai/dsh-session-telemetry-otel` 下,运维记录挂在 `@deepseek-ai/dsh-session-telemetry-otel/ops` 下——使接收端可以在不累加它们的情况下对运维记录告警。资源身份携带 `service.name`/`service.version`(来自 `dsh-llm` 的 `APP_IDENTITY`)以及本包的匿名 `user.id`(来自 `$DSH_HOME/.anonymous-user-id`),按导出批次携带一次,而非逐条记录。
|
|
87
|
+
|
|
88
|
+
### 源码地图
|
|
89
|
+
|
|
90
|
+
| 文件 | 职责 |
|
|
23
91
|
|---|---|
|
|
24
|
-
| `
|
|
25
|
-
| `FEEDBACK_ONLY` | 每个 `feedback/record` 都会回放权威会话日志中截至该事件的后缀,并进行投影与脱敏。后续记录等待下一个反馈事件;如果没有后续反馈,则留在本地。 |
|
|
26
|
-
| `DISABLED` | 默认值。不构造协调器、提供方、处理器或导出器。没有遥测记录会离开进程。`feedback/record` 会记录 `session sessionTelemetry is DISABLED; nothing will be shared and this feedback remains local`;该事件留在本地会话日志中。 |
|
|
92
|
+
| [`src/index.ts`](src/index.ts) | 插件入口:模式解析、fail-closed 校验、SDK 流水线接线、协调器组装、关闭截止时间 |
|
|
27
93
|
|
|
28
|
-
|
|
94
|
+
### 捕获接线
|
|
29
95
|
|
|
30
|
-
|
|
96
|
+
`FULL` 以 `live` 模式组装协调器,并放行直接服务调用;`FEEDBACK_ONLY` 以 `on-demand` 模式组装协调器,给协调器一个私有后端能力,并且只对权威日志中精确的反馈记录触发 `captureSession(session, event.seq)`;`DISABLED` 除了在 `feedback/record` 上发出警告外不注册任何内容。后端刻意不实现 `flush()`:常规 flush 由批处理器负责,把提示转发给 `forceFlush()` 会成为并发 flush 的唯一来源,而它与关闭排空的交互没有文档。
|
|
31
97
|
|
|
32
|
-
|
|
98
|
+
### 字段映射
|
|
33
99
|
|
|
34
|
-
|
|
100
|
+
每条 seam 记录映射为一条 SDK 日志记录:`time` 与 `severity` 变为 SDK 的时间戳与严重级别字段,`body` 与 `attributes` 原样照搬;确切字段映射见 [`src/index.ts`](src/index.ts)。在 `FULL` 中,接收端可通过缺少 `shutdown` 记录检测崩溃——该标记在会话自身 dispose(资源释放)或应用关闭时发出,标记之后出现更多事件说明遥测发生了重载。在 `FEEDBACK_ONLY` 中,已释放的前缀通常不包含随后的 `shutdown` 标记,因此缺少该标记不是崩溃信号。
|
|
35
101
|
|
|
36
|
-
|
|
102
|
+
</details>
|
|
37
103
|
|
|
38
|
-
|
|
104
|
+
-----
|
|
39
105
|
|
|
40
|
-
|
|
106
|
+
<a id="further-exploration"></a>
|
|
107
|
+
## 进一步探索
|
|
41
108
|
|
|
42
|
-
seam
|
|
109
|
+
当后端约定不够用时阅读以下页面。它们从它所实现的 seam 逐步进入子系统参考与它所上报的身份。
|
|
43
110
|
|
|
111
|
+
- [会话遥测 seam](../session-telemetry/README.zh.md)——捕获约定、记录词汇与脱敏 waterfall。
|
|
112
|
+
- [会话遥测子系统](../../../docs/subsystems/session-telemetry.zh.md)——能力拆分与类型声明。
|
|
113
|
+
- [匿名用户身份](../../identity/anonymous-user-id/README.zh.md)——作为 OTel Resource `user.id` 上报的 id。
|
|
114
|
+
- [生成配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-session-telemetry-otel)——每个受支持配置字段及其源声明。
|
|
115
|
+
|
|
116
|
+
-----
|
|
117
|
+
|
|
118
|
+
<a id="model-experience"></a>
|
|
44
119
|
## 模型体验
|
|
45
120
|
|
|
46
|
-
|
|
121
|
+
无,因为该后端把 seam 记录转发进 OTel SDK 流水线,不注册任何面向模型的内容。
|
|
47
122
|
|
|
48
123
|
#### KV Cache 影响
|
|
49
124
|
|
|
50
125
|
无;本包既不组装也不发送提供方请求。
|
|
51
126
|
|
|
52
|
-
##
|
|
127
|
+
## 已知限制与延期工作
|
|
128
|
+
|
|
129
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
这些限制说明 SDK 行为在何处起主导作用、导出保证止于何处。它们是当前包约束。
|
|
133
|
+
|
|
134
|
+
- **上游实验性源码树**——`@opentelemetry/sdk-logs` 从上游实验性源码树发布;SDK API 的变动只会落在本包,也仅落在本包,而 seam 约定不动。
|
|
135
|
+
- **真实 collector 行为属于 SDK 导出器**——身份验证、TLS、限流及其他真实 OTLP 部署行为遵循上游 SDK,不由本包自有兼容层处理。
|
|
136
|
+
- **反馈时快照**——`FEEDBACK_ONLY` 在反馈前不保留遥测自有副本;记录反馈时读取并脱敏当前的权威日志,因此反馈前崩溃时什么都不上传,反馈前的策略变更会影响该次回放的导出内容。
|
|
137
|
+
|
|
138
|
+
<a id="dev-note"></a>
|
|
139
|
+
### 开发备注
|
|
140
|
+
|
|
141
|
+
<details>
|
|
142
|
+
<summary>维护者的工作上下文——点击展开</summary>
|
|
143
|
+
|
|
144
|
+
无。
|
|
53
145
|
|
|
54
|
-
|
|
55
|
-
- **真实 collector 行为属于 SDK 导出器**:身份验证、TLS、限流及其他真实 OTLP 部署行为遵循上游 SDK,不由本包自有兼容层处理。
|
|
56
|
-
- **反馈时快照**:`FEEDBACK_ONLY` 在反馈前不保留遥测自有副本。记录反馈时,它读取并脱敏当前的权威日志;反馈前发生崩溃时什么都不上传,而反馈前的策略变更会影响该次回放的导出内容。
|
|
146
|
+
</details>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-telemetry-otel",
|
|
3
3
|
"description": "OpenTelemetry backend for the DeepSeek Harness telemetry seam: hands captured session records to the OTel JS SDK's log pipeline",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -38,25 +38,33 @@
|
|
|
38
38
|
"@opentelemetry/otlp-exporter-base": "^0.220.0",
|
|
39
39
|
"@opentelemetry/resources": "^2.9.0",
|
|
40
40
|
"@opentelemetry/sdk-logs": "^0.220.0",
|
|
41
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
41
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@deepseek-ai/dsh-command-feedback": "^0.1.
|
|
45
|
-
"@deepseek-ai/dsh-
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
48
|
-
"@deepseek-ai/dsh-session
|
|
49
|
-
"@deepseek-ai/dsh-anonymous-user-id": "^0.1.
|
|
50
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
44
|
+
"@deepseek-ai/dsh-command-feedback": "^0.1.2-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-session-telemetry": "^0.1.2-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-anonymous-user-id": "^0.1.2-alpha.2",
|
|
50
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@deepseek-ai/cordis-plugin-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/
|
|
53
|
+
"@deepseek-ai/cordis-plugin-logger-console": "^1.0.2",
|
|
54
|
+
"@deepseek-ai/dsh-app-boot": "^0.1.2-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-bash-local": "^0.1.2-alpha.2",
|
|
56
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
57
|
+
"@deepseek-ai/dsh-agent-spine-demo": "^0.1.2-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-command-feedback": "^0.1.2-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-loader-smoke": "^0.1.2-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-session-checkpoint-policy": "^0.1.2-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.2-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-session-telemetry": "^0.1.2-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-subprocess-local": "^0.1.2-alpha.2",
|
|
67
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
68
|
+
"@deepseek-ai/dsh-anonymous-user-id": "^0.1.2-alpha.2"
|
|
61
69
|
}
|
|
62
70
|
}
|