Commit 71bcce7
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
- src/telemetry/export
- writers
- test/unit
- remote
- telemetry
- export/writers
- sinks
- util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
| 678 | + | |
| 679 | + | |
678 | 680 | | |
679 | 681 | | |
680 | 682 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments