@deepseek-ai/dsh-otel 0.2.3-alpha.1 → 0.2.3-alpha.3
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 +4 -4
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/lib/index.js +34 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/session-log-batch.d.ts +41 -0
- package/lib/types/session-log-batch.d.ts.map +1 -0
- package/lib/types/session-log-batch.js.map +1 -0
- package/lib/types/session-log.d.ts +9 -0
- package/lib/types/session-log.d.ts.map +1 -1
- package/lib/types/session-log.js.map +1 -1
- package/package.json +6 -6
- package/src/index.ts +1 -0
- package/src/session-log-batch.ts +40 -0
- package/src/session-log.ts +37 -0
package/README.i18n.yaml
CHANGED
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
en: 23386452a66b2fbd
|
|
16
16
|
zh: 55b2121ae6059425
|
|
17
17
|
/deepseek-ai-dsh-otel/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
18
|
+
en: f0ab24e34299f01a
|
|
19
|
+
zh: 9d4986ea82e5f2f2
|
|
20
20
|
/deepseek-ai-dsh-otel/understand-the-implementation:
|
|
21
|
-
en:
|
|
22
|
-
zh:
|
|
21
|
+
en: 28f889f19d130181
|
|
22
|
+
zh: b963f0a1a41d780a
|
|
23
23
|
/deepseek-ai-dsh-otel/further-exploration:
|
|
24
24
|
en: ee17b991de098cc0
|
|
25
25
|
zh: f90257e411921f2b
|
package/README.md
CHANGED
|
@@ -27,14 +27,14 @@ The base bundle mounts `@deepseek-ai/dsh-otel`. Independent compositions must mo
|
|
|
27
27
|
|
|
28
28
|
The returned channel belongs to the consumer. Ordinary-event `shutdown(signal)` cancels requests and retry waits when the supplied signal aborts, and resolves after transport cleanup. Register shutdown with the consumer's Cordis fiber and bound the complete drain with its configured deadline. Injection makes service replacement unload dependent consumers. Do not retain a channel after its consumer unloads. The product and Session adapters implement this ownership for UI and feedback callers.
|
|
29
29
|
|
|
30
|
-
Ordinary channels use SDK count-based batching. Session channels
|
|
30
|
+
Ordinary channels use SDK count-based batching. Session channels enforce at most 4,000,000 uncompressed request bytes and accept two record formats from their consumer. `reportSessionLog` keeps one complete event per record with `eventName: "session-log"`, `sessionId`, and a JSON string `content`. `reportSessionLogBatch` emits one record per contiguous per-Session delivery batch: its attributes carry `session.id`, `session.format_version`, the Session header's `session.cwd` / `session.parent_id` / `session.seed_length` when present, and the `delivery.*` cursor range (`batch_id`, `after_seq`, `through_seq`, `event_count`, `purpose`), and its body is a JSON string `{"events":[...]}` whose entries match the DeepSeek session-log wire event: `seq`, `time`, `type`, `data`, and the optional `surfaceOp` / `sourceEventSeqs`. `serializeSessionLogEvent` produces one event's canonical wire text, which consumers also use to measure batch bytes. Their byte limits, single-record rejection, serial transport settlement, and shutdown behavior are specified by the [Session adapter](../../session/session-telemetry-otel/README.md). A Session channel never shares a request or queue with ordinary events.
|
|
31
31
|
|
|
32
32
|
Headers are explicit. The service does not add a channel header or inherit ambient authorization headers or TLS identity. Agent factories configure their returned agents, including keepAlive. Ordinary-event channels destroy their agent on shutdown; factories must provide a dedicated agent for each channel. Scope names and versions are supplied by each consumer, so transport sharing does not change event attribution.
|
|
33
33
|
|
|
34
34
|
<a id="understand-the-implementation"></a>
|
|
35
35
|
## Understand the implementation
|
|
36
36
|
|
|
37
|
-
`src/index.ts` registers the service; `event-log.ts` owns ordinary SDK batching; `session-log.ts` owns byte/count scheduling; `transport.ts` supplies the Session SDK JSON HTTP delegate and owns the shared exporter metrics recorder, which receives no meter provider and records nothing; `event-transport.ts` uses Got for cancellable ordinary-event HTTP requests and retry waits with SDK serialization and export accounting. No global OTel provider is installed; the accepted exporter options exclude the upstream `selfObsMeterProvider`, and the Session processor accepts only the batching fields it implements, so exporter and Session-processor self-observability metrics stay unrecorded. The Session processor measures each record once, groups conservative sizes, and waits for the SDK concurrency queue to clear after every callback before sending another request.
|
|
37
|
+
`src/index.ts` registers the service; `event-log.ts` owns ordinary SDK batching; `session-log.ts` owns byte/count scheduling; `session-log-batch.ts` owns delivery-batch record serialization; `transport.ts` supplies the Session SDK JSON HTTP delegate and owns the shared exporter metrics recorder, which receives no meter provider and records nothing; `event-transport.ts` uses Got for cancellable ordinary-event HTTP requests and retry waits with SDK serialization and export accounting. No global OTel provider is installed; the accepted exporter options exclude the upstream `selfObsMeterProvider`, and the Session processor accepts only the batching fields it implements, so exporter and Session-processor self-observability metrics stay unrecorded. The Session processor measures each record once, groups conservative sizes, and waits for the SDK concurrency queue to clear after every callback before sending another request.
|
|
38
38
|
|
|
39
39
|
OpenTelemetry SDK dependencies use exact versions from one coordinated release across this service and its two adapters.
|
|
40
40
|
|
package/README.zh.md
CHANGED
|
@@ -27,14 +27,14 @@ base bundle 挂载 `@deepseek-ai/dsh-otel`。独立组合必须在注入 `otel`
|
|
|
27
27
|
|
|
28
28
|
返回的通道由调用方持有。普通事件 `shutdown(signal)` 在传入信号中止时取消请求和重试等待,并在传输清理完成后返回。将关闭注册到调用方的 Cordis fiber,并用配置的期限约束完整清空过程。注入机制使服务替换时卸载依赖方。调用方卸载后不得继续保留通道。产品和 Session 适配器为 UI 和反馈调用方实现这些职责。
|
|
29
29
|
|
|
30
|
-
普通通道使用 SDK 按条数聚合。Session
|
|
30
|
+
普通通道使用 SDK 按条数聚合。Session 通道保证未压缩请求不超过 4,000,000 字节,并接受调用方的两种记录格式。`reportSessionLog` 每条完整事件一个记录,包含 `eventName: "session-log"`、`sessionId` 和 JSON 字符串 `content`。`reportSessionLogBatch` 每次连续的单 Session 投递批次一个记录:attributes 携带 `session.id`、`session.format_version`、会话 header 存在时的 `session.cwd` / `session.parent_id` / `session.seed_length`,以及 `delivery.*` 游标区间(`batch_id`、`after_seq`、`through_seq`、`event_count`、`purpose`),body 为 JSON 字符串 `{"events":[...]}`,其中每个事件与 DeepSeek 会话日志线上事件一致:`seq`、`time`、`type`、`data`,以及可选的 `surfaceOp` / `sourceEventSeqs`。`serializeSessionLogEvent` 产出一个事件的规范线上文本,调用方也用它计量批次字节。字节限制、单条拒绝、串行传输结束和关闭行为见 [Session 适配器](../../session/session-telemetry-otel/README.zh.md)。Session 通道不会与普通事件共享请求或队列。
|
|
31
31
|
|
|
32
32
|
Header 显式提供。服务不会附加 channel header,也不继承环境中的授权 header 或 TLS 身份。Agent factory 配置返回的 agent,包括 keepAlive。普通事件通道在关闭时销毁自己的 agent;factory 必须为每个通道提供独立 agent。每个调用方提供 scope 名称和版本,因此共享传输不会改变事件归属。
|
|
33
33
|
|
|
34
34
|
<a id="understand-the-implementation"></a>
|
|
35
35
|
## 理解实现
|
|
36
36
|
|
|
37
|
-
`src/index.ts` 注册服务;`event-log.ts` 负责普通事件的 SDK 聚合;`session-log.ts` 负责字节和条数调度;`transport.ts` 提供 Session 的 SDK JSON HTTP delegate,并持有共享的 exporter 指标记录器(不接收 meter provider,不记录任何指标);`event-transport.ts` 使用 Got 实现可取消的普通事件 HTTP 请求和重试等待,序列化与导出计数仍由 SDK 负责。不安装全局 OTel provider;接受的 exporter 选项排除上游的 `selfObsMeterProvider`,Session processor 也只接受它实现的聚合字段,因此 exporter 和 Session processor 的自观测指标都不会被记录。Session processor 对每条记录只计量一次,按保守大小组包,并在每次回调后等待 SDK 并发队列清理完成才发送下一请求。
|
|
37
|
+
`src/index.ts` 注册服务;`event-log.ts` 负责普通事件的 SDK 聚合;`session-log.ts` 负责字节和条数调度;`session-log-batch.ts` 负责投递批次记录序列化;`transport.ts` 提供 Session 的 SDK JSON HTTP delegate,并持有共享的 exporter 指标记录器(不接收 meter provider,不记录任何指标);`event-transport.ts` 使用 Got 实现可取消的普通事件 HTTP 请求和重试等待,序列化与导出计数仍由 SDK 负责。不安装全局 OTel provider;接受的 exporter 选项排除上游的 `selfObsMeterProvider`,Session processor 也只接受它实现的聚合字段,因此 exporter 和 Session processor 的自观测指标都不会被记录。Session processor 对每条记录只计量一次,按保守大小组包,并在每次回调后等待 SDK 并发队列清理完成才发送下一请求。
|
|
38
38
|
|
|
39
39
|
本服务及其两个适配器的 OpenTelemetry SDK 依赖使用同一配套版本系列的精确版本。
|
|
40
40
|
|
package/lib/index.js
CHANGED
|
@@ -366,6 +366,40 @@ var SessionLogReporter = class {
|
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Enqueue one complete delivery batch as a single record. The record's body
|
|
371
|
+
* carries the canonical events JSON; batch attributes identify the covered
|
|
372
|
+
* cursor range and its idempotency key. Network delivery is not acknowledged.
|
|
373
|
+
* @param batch - one contiguous per-Session range with already-redacted payloads; must not be empty.
|
|
374
|
+
* @throws when the batch carries no event, so it has no covered cursor range.
|
|
375
|
+
*/
|
|
376
|
+
reportSessionLogBatch(batch) {
|
|
377
|
+
const last = batch.events.at(-1);
|
|
378
|
+
if (last === void 0) throw new Error("Session log batch must carry at least one event");
|
|
379
|
+
const events = batch.events.map((event) => JSON.stringify(event));
|
|
380
|
+
const time = last.time;
|
|
381
|
+
const severityNumber = batch.severityNumber ?? SeverityNumber.INFO;
|
|
382
|
+
this.logger.emit({
|
|
383
|
+
eventName: "session-log",
|
|
384
|
+
body: `{"events":[${events.join(",")}]}`,
|
|
385
|
+
timestamp: time,
|
|
386
|
+
observedTimestamp: time,
|
|
387
|
+
severityNumber,
|
|
388
|
+
severityText: SeverityNumber[severityNumber],
|
|
389
|
+
attributes: {
|
|
390
|
+
"session.id": batch.sessionId,
|
|
391
|
+
"session.format_version": batch.formatVersion,
|
|
392
|
+
...batch.cwd === void 0 ? {} : { "session.cwd": batch.cwd },
|
|
393
|
+
...batch.parentSessionId === void 0 ? {} : { "session.parent_id": batch.parentSessionId },
|
|
394
|
+
...batch.seedLength === void 0 ? {} : { "session.seed_length": batch.seedLength },
|
|
395
|
+
"delivery.batch_id": batch.batchId,
|
|
396
|
+
"delivery.after_seq": batch.afterSeq,
|
|
397
|
+
"delivery.through_seq": batch.throughSeq,
|
|
398
|
+
"delivery.event_count": batch.events.length,
|
|
399
|
+
"delivery.purpose": batch.purpose
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
}
|
|
369
403
|
/** Stop queued requests after the owning backend's shutdown deadline; an active transport may still settle. */
|
|
370
404
|
stopPending() {
|
|
371
405
|
this.processor.stopPending();
|
package/lib/types/index.d.ts
CHANGED
|
@@ -27,5 +27,6 @@ export default class OTel extends Service {
|
|
|
27
27
|
}
|
|
28
28
|
export type { EventLogOptions, OTelEventRecord, OTelEventScalar, EventLogReporter } from './event-log.ts';
|
|
29
29
|
export type { SessionLogProcessorOptions, SessionLogRecord, SessionLogOptions, SessionLogReporter } from './session-log.ts';
|
|
30
|
+
export type { SessionLogBatch, SessionLogBatchEvent } from './session-log-batch.ts';
|
|
30
31
|
export type { LogExporterOptions } from './transport.ts';
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACvE,OAAO,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE7E,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,IAAI,EAAE,IAAI,CAAA;KACX;CACF;AAED,6FAA6F;AAC7F,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;gBAC3B,GAAG,EAAE,OAAO;IAExB;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB;IAE/D;;;;;OAKG;IACH,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,kBAAkB;CACzE;AAED,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACzG,YAAY,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC3H,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACvE,OAAO,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE7E,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,IAAI,EAAE,IAAI,CAAA;KACX;CACF;AAED,6FAA6F;AAC7F,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;gBAC3B,GAAG,EAAE,OAAO;IAExB;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB;IAE/D;;;;;OAKG;IACH,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,kBAAkB;CACzE;AAED,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACzG,YAAY,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC3H,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACnF,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Batched Session-log records: one OTLP record per contiguous per-Session delivery batch. */
|
|
2
|
+
import type { SessionEvent, SessionId } from '@deepseek-ai/dsh-session';
|
|
3
|
+
import type { SeverityNumber } from '@opentelemetry/api-logs';
|
|
4
|
+
/** One canonical event envelope with its separately redacted payload. */
|
|
5
|
+
export type SessionLogBatchEvent = Omit<SessionEvent, 'data'> & {
|
|
6
|
+
data: unknown;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* One delivery batch reported as one OTLP log record. A batch covers a single
|
|
10
|
+
* Session's contiguous sequence range: {@link events} are exactly
|
|
11
|
+
* {@link afterSeq} + 1 .. {@link throughSeq} with no hole. Batches never mix
|
|
12
|
+
* Sessions or purposes, and {@link batchId} is unique per formed batch.
|
|
13
|
+
*/
|
|
14
|
+
export interface SessionLogBatch {
|
|
15
|
+
/** Session the whole range belongs to. */
|
|
16
|
+
readonly sessionId: SessionId;
|
|
17
|
+
/** Session format generation the sequence numbers belong to. */
|
|
18
|
+
readonly formatVersion: number;
|
|
19
|
+
/** Sequence before this batch's first event; skipped sequences are never covered. */
|
|
20
|
+
readonly afterSeq: number;
|
|
21
|
+
/** Highest sequence represented by {@link events}. */
|
|
22
|
+
readonly throughSeq: number;
|
|
23
|
+
/** Session working directory at capture time; omitted when the Session header carries none. */
|
|
24
|
+
readonly cwd?: string;
|
|
25
|
+
/** Parent Session id of a seeded (forked) Session; omitted for unseeded Sessions. */
|
|
26
|
+
readonly parentSessionId?: string;
|
|
27
|
+
/** Exact inherited prefix length of a seeded Session; omitted for unseeded Sessions. */
|
|
28
|
+
readonly seedLength?: number;
|
|
29
|
+
/** Idempotency key; a UUID unique to this formed batch. */
|
|
30
|
+
readonly batchId: string;
|
|
31
|
+
/**
|
|
32
|
+
* Delivery purpose: {@link BATCH_PURPOSE_CONVERSATION} today; session-title,
|
|
33
|
+
* compaction, auto-review, and translation are reserved for later capture paths.
|
|
34
|
+
*/
|
|
35
|
+
readonly purpose: string;
|
|
36
|
+
/** Complete event envelopes for every sequence from {@link afterSeq} + 1 through {@link throughSeq}. */
|
|
37
|
+
readonly events: readonly SessionLogBatchEvent[];
|
|
38
|
+
/** Highest event severity in the batch; omitted uses INFO. */
|
|
39
|
+
readonly severityNumber?: SeverityNumber;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=session-log-batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-log-batch.d.ts","sourceRoot":"","sources":["../../src/session-log-batch.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,yEAAyE;AACzE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAA;AAEjF;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,sDAAsD;IACtD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,+FAA+F;IAC/F,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,qFAAqF;IACrF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,wFAAwF;IACxF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,wGAAwG;IACxG,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAChD,8DAA8D;IAC9D,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAA;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-log-batch.js","sourceRoot":"","sources":["../../src/session-log-batch.ts"],"names":[],"mappings":""}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { SessionEvent, SessionId } from '@deepseek-ai/dsh-session';
|
|
3
3
|
import type { Attributes } from '@opentelemetry/api';
|
|
4
4
|
import { SeverityNumber } from '@opentelemetry/api-logs';
|
|
5
|
+
import type { SessionLogBatch } from './session-log-batch.ts';
|
|
5
6
|
import { type BatchLogRecordProcessorOptions } from '@opentelemetry/sdk-logs';
|
|
6
7
|
import { type LogExporterOptions } from './transport.ts';
|
|
7
8
|
/** Collector request ceiling in uncompressed UTF-8 bytes, including the OTLP envelope. */
|
|
@@ -61,6 +62,14 @@ export declare class SessionLogReporter {
|
|
|
61
62
|
* @param record - event with redacted data and its original Session id.
|
|
62
63
|
*/
|
|
63
64
|
reportSessionLog(record: SessionLogRecord): void;
|
|
65
|
+
/**
|
|
66
|
+
* Enqueue one complete delivery batch as a single record. The record's body
|
|
67
|
+
* carries the canonical events JSON; batch attributes identify the covered
|
|
68
|
+
* cursor range and its idempotency key. Network delivery is not acknowledged.
|
|
69
|
+
* @param batch - one contiguous per-Session range with already-redacted payloads; must not be empty.
|
|
70
|
+
* @throws when the batch carries no event, so it has no covered cursor range.
|
|
71
|
+
*/
|
|
72
|
+
reportSessionLogBatch(batch: SessionLogBatch): void;
|
|
64
73
|
/** Stop queued requests after the owning backend's shutdown deadline; an active transport may still settle. */
|
|
65
74
|
stopPending(): void;
|
|
66
75
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-log.d.ts","sourceRoot":"","sources":["../../src/session-log.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0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DAA4D;IAC5D,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACzC,uEAAuE;IACvE,kBAAkB,EAAE,UAAU,CAAA;IAC9B,2FAA2F;IAC3F,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAA;CACpD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,WAAW,CAAC,GAAG,MAAM,CAejH;AAkHD,4FAA4F;AAC5F,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAEhE,6FAA6F;gBACjF,OAAO,EAAE,iBAAiB;IAgBtC;;;OAGG;IACH,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAUhD;;;;;;OAMG;IACH,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IA6BnD,+GAA+G;IAC/G,WAAW,IAAI,IAAI;IAEnB;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-log.js","sourceRoot":"","sources":["../../src/session-log.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"session-log.js","sourceRoot":"","sources":["../../src/session-log.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAA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,eAAe,EAAE;gBAC5F,GAAG,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,KAAK,CAAC,UAAU,EAAE;gBACpF,mBAAmB,EAAE,KAAK,CAAC,OAAO;gBAClC,oBAAoB,EAAE,KAAK,CAAC,QAAQ;gBACpC,sBAAsB,EAAE,KAAK,CAAC,UAAU;gBACxC,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;gBAC3C,kBAAkB,EAAE,KAAK,CAAC,OAAO;aAClC;SACF,CAAC,CAAA;IACJ,CAAC;IAED,+GAA+G;IAC/G,WAAW,KAAW,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAA,CAAC,CAAC;IAEpD;;;OAGG;IACH,QAAQ,KAAoB,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAA,CAAC,CAAC;CAC9D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-otel",
|
|
3
3
|
"description": "Cordis service for independent ordinary-event and byte-bounded Session-log OTLP channels",
|
|
4
|
-
"version": "0.2.3-alpha.
|
|
4
|
+
"version": "0.2.3-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"got": "^14.6.6"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@deepseek-ai/cordis": "~4.
|
|
46
|
-
"@deepseek-ai/dsh-session": "0.2.3-alpha.
|
|
45
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@deepseek-ai/dsh-brand": "0.2.3-alpha.
|
|
50
|
-
"@deepseek-ai/cordis": "~4.
|
|
51
|
-
"@deepseek-ai/dsh-session": "0.2.3-alpha.
|
|
49
|
+
"@deepseek-ai/dsh-brand": "0.2.3-alpha.3",
|
|
50
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.3"
|
|
52
52
|
}
|
|
53
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -32,4 +32,5 @@ export default class OTel extends Service {
|
|
|
32
32
|
|
|
33
33
|
export type { EventLogOptions, OTelEventRecord, OTelEventScalar, EventLogReporter } from './event-log.ts'
|
|
34
34
|
export type { SessionLogProcessorOptions, SessionLogRecord, SessionLogOptions, SessionLogReporter } from './session-log.ts'
|
|
35
|
+
export type { SessionLogBatch, SessionLogBatchEvent } from './session-log-batch.ts'
|
|
35
36
|
export type { LogExporterOptions } from './transport.ts'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Batched Session-log records: one OTLP record per contiguous per-Session delivery batch. */
|
|
2
|
+
import type { SessionEvent, SessionId } from '@deepseek-ai/dsh-session'
|
|
3
|
+
import type { SeverityNumber } from '@opentelemetry/api-logs'
|
|
4
|
+
|
|
5
|
+
/** One canonical event envelope with its separately redacted payload. */
|
|
6
|
+
export type SessionLogBatchEvent = Omit<SessionEvent, 'data'> & { data: unknown }
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* One delivery batch reported as one OTLP log record. A batch covers a single
|
|
10
|
+
* Session's contiguous sequence range: {@link events} are exactly
|
|
11
|
+
* {@link afterSeq} + 1 .. {@link throughSeq} with no hole. Batches never mix
|
|
12
|
+
* Sessions or purposes, and {@link batchId} is unique per formed batch.
|
|
13
|
+
*/
|
|
14
|
+
export interface SessionLogBatch {
|
|
15
|
+
/** Session the whole range belongs to. */
|
|
16
|
+
readonly sessionId: SessionId
|
|
17
|
+
/** Session format generation the sequence numbers belong to. */
|
|
18
|
+
readonly formatVersion: number
|
|
19
|
+
/** Sequence before this batch's first event; skipped sequences are never covered. */
|
|
20
|
+
readonly afterSeq: number
|
|
21
|
+
/** Highest sequence represented by {@link events}. */
|
|
22
|
+
readonly throughSeq: number
|
|
23
|
+
/** Session working directory at capture time; omitted when the Session header carries none. */
|
|
24
|
+
readonly cwd?: string
|
|
25
|
+
/** Parent Session id of a seeded (forked) Session; omitted for unseeded Sessions. */
|
|
26
|
+
readonly parentSessionId?: string
|
|
27
|
+
/** Exact inherited prefix length of a seeded Session; omitted for unseeded Sessions. */
|
|
28
|
+
readonly seedLength?: number
|
|
29
|
+
/** Idempotency key; a UUID unique to this formed batch. */
|
|
30
|
+
readonly batchId: string
|
|
31
|
+
/**
|
|
32
|
+
* Delivery purpose: {@link BATCH_PURPOSE_CONVERSATION} today; session-title,
|
|
33
|
+
* compaction, auto-review, and translation are reserved for later capture paths.
|
|
34
|
+
*/
|
|
35
|
+
readonly purpose: string
|
|
36
|
+
/** Complete event envelopes for every sequence from {@link afterSeq} + 1 through {@link throughSeq}. */
|
|
37
|
+
readonly events: readonly SessionLogBatchEvent[]
|
|
38
|
+
/** Highest event severity in the batch; omitted uses INFO. */
|
|
39
|
+
readonly severityNumber?: SeverityNumber
|
|
40
|
+
}
|
package/src/session-log.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { SessionEvent, SessionId } from '@deepseek-ai/dsh-session'
|
|
3
3
|
import type { Attributes } from '@opentelemetry/api'
|
|
4
4
|
import { SeverityNumber } from '@opentelemetry/api-logs'
|
|
5
|
+
import type { SessionLogBatch } from './session-log-batch.ts'
|
|
5
6
|
import { ExportResultCode } from '@opentelemetry/core'
|
|
6
7
|
import { JsonLogsSerializer } from '@opentelemetry/otlp-transformer'
|
|
7
8
|
import { resourceFromAttributes } from '@opentelemetry/resources'
|
|
@@ -217,6 +218,42 @@ export class SessionLogReporter {
|
|
|
217
218
|
})
|
|
218
219
|
}
|
|
219
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Enqueue one complete delivery batch as a single record. The record's body
|
|
223
|
+
* carries the canonical events JSON; batch attributes identify the covered
|
|
224
|
+
* cursor range and its idempotency key. Network delivery is not acknowledged.
|
|
225
|
+
* @param batch - one contiguous per-Session range with already-redacted payloads; must not be empty.
|
|
226
|
+
* @throws when the batch carries no event, so it has no covered cursor range.
|
|
227
|
+
*/
|
|
228
|
+
reportSessionLogBatch(batch: SessionLogBatch): void {
|
|
229
|
+
const last = batch.events.at(-1)
|
|
230
|
+
if (last === undefined) throw new Error('Session log batch must carry at least one event')
|
|
231
|
+
const events = batch.events.map(event => JSON.stringify(event))
|
|
232
|
+
// The record timestamp is the batch's newest event time.
|
|
233
|
+
const time = last.time
|
|
234
|
+
const severityNumber = batch.severityNumber ?? SeverityNumber.INFO
|
|
235
|
+
this.logger.emit({
|
|
236
|
+
eventName: 'session-log',
|
|
237
|
+
body: `{"events":[${events.join(',')}]}`,
|
|
238
|
+
timestamp: time,
|
|
239
|
+
observedTimestamp: time,
|
|
240
|
+
severityNumber,
|
|
241
|
+
severityText: SeverityNumber[severityNumber],
|
|
242
|
+
attributes: {
|
|
243
|
+
'session.id': batch.sessionId,
|
|
244
|
+
'session.format_version': batch.formatVersion,
|
|
245
|
+
...batch.cwd === undefined ? {} : { 'session.cwd': batch.cwd },
|
|
246
|
+
...batch.parentSessionId === undefined ? {} : { 'session.parent_id': batch.parentSessionId },
|
|
247
|
+
...batch.seedLength === undefined ? {} : { 'session.seed_length': batch.seedLength },
|
|
248
|
+
'delivery.batch_id': batch.batchId,
|
|
249
|
+
'delivery.after_seq': batch.afterSeq,
|
|
250
|
+
'delivery.through_seq': batch.throughSeq,
|
|
251
|
+
'delivery.event_count': batch.events.length,
|
|
252
|
+
'delivery.purpose': batch.purpose,
|
|
253
|
+
},
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
|
|
220
257
|
/** Stop queued requests after the owning backend's shutdown deadline; an active transport may still settle. */
|
|
221
258
|
stopPending(): void { this.processor.stopPending() }
|
|
222
259
|
|