Skip to content

Commit 71bcce7

Browse files
committed
refactor(telemetry): tighten OTLP export writer and tests
- Restructure: writers.ts → writers/json.ts; combine OTLP mapping and writer into writers/otlp.ts; lift signal classification into export/signal.ts. - Group all records of each signal under a single Resource block per file (was one Resource per event), matching the OTLP spec's recommended shape and shrinking exports at scale. - Adopt OTLP enums from @opentelemetry/api + api-logs; document the +1 wire offset on SpanKind. - Tighten the public surface: only writeOtlpZipExport and OtlpExportCounts are exported; record mappers are module-private. - Hoist per-event metric attributes once; single-pass partition of http.requests measurements into counts and gauges. - Share parseTelemetryTimestampMs between range.ts and the OTLP writer's nanos conversion (was duplicated with identical error). - Extract asyncIterable test helper to test/mocks/; inline the memfs vi.mock pair across affected test files. - Tests now exercise the public API only, dropping side-effect assertions about staging cleanup and atomic semantics already covered by writeAtomically's own tests.
1 parent 64f1163 commit 71bcce7

10 files changed

Lines changed: 832 additions & 359 deletions

File tree

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@
675675
],
676676
"dependencies": {
677677
"@abraham/reflection": "^0.13.0",
678+
"@opentelemetry/api": "^1.9.1",
679+
"@opentelemetry/api-logs": "^0.218.0",
678680
"@peculiar/x509": "^2.0.0",
679681
"@repo/shared": "workspace:*",
680682
"axios": "^1.16.1",

pnpm-lock.yaml

Lines changed: 24 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)