Skip to content

Add standalone OTLP JSON Lines reader and writer - #1048

Merged
JacobStephens2 merged 2 commits into
issue-700from
issue-982
Oct 22, 2026
Merged

JacobStephens2 merged 2 commits into
issue-700from
issue-982

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add an application-independent OTLP JSON Lines reader and writer for log records
and spans, ready for Session-trace recording. No new run-time packages.

src/otlp_jsonl.rs          typed requests; one signal per stream; flush each line
src/otlp_jsonl/value.rs    all attribute types, base64 bytes, special doubles
src/otlp_jsonl/integer.rs  exact decimal/exponent integer decoding
src/otlp_jsonl/fixtures/   official examples and local Collector configuration

Closes #982

Evidence

  • Before: the review's exact regressions reproduced a finite double changing
    from 8.971135692166839e-150 to 8.97113569216684e-150, and rejected
    timeUnixNano: "4.2e1".
    After: both exact selectors pass; both regression tests are retained.

    cargo test --bin thirdshift otlp_jsonl::tests::finite_double_reads_back_without_changing_bits -- --exact
    cargo test --bin thirdshift otlp_jsonl::tests::reader_accepts_protojson_integer_spellings_without_rounding -- --exact
  • All 13 codec tests pass in isolation. Official protocol types verify both
    signals, and the specification's log, event, trace and JSON Lines examples
    preserve their values.

  • Collector v0.163.2 read and re-exported two log requests and two span
    requests with identical JSON values. Result and reproduction steps are in
    docs/research/otlp-file-writer.md.

  • cargo check and cargo clippy --all-targets -- -D warnings pass. The normal
    dependency package set is identical to issue-700.

  • /usr/bin/time -p scripts/affected-tests issue-700 selected cargo nextest run:
    2,236 passed, 2 skipped, exit 0. Wall time 2,024.49 seconds, including
    compilation and the initial build-lock wait (test execution: 1,954.491 seconds).

Test seams

  • The standalone otlp_jsonl module's typed requests, Writer and Reader: inspect emitted JSON, decode with OpenTelemetry's official protocol types, and read back through the same public interface. Specification fixtures supply independent expected values.
  • One-time interoperability: the Collector's otlp_json_file receiver reads files emitted through that interface and its file exporter writes the records and spans back.

Review

Reviewed against fixed point issue-700 (cd7119f), with independent Standards
and Spec reviewers. Standards' one P3 duplication finding was addressed; Spec's
two P2 behavior findings were reproduced with their exact commands, fixed and
verified with the same commands. Both axes read all 17 changed files, including
the follow-up changes. No generated-output exclusions or unread changed files.

Unaddressed findings

Standards

None.

Spec

None.

Merge Danger

Door: two-way

The codec can be removed without a data migration.

Blast Radius: serialization

serde_json precision features apply across the binary; full Rust validation
covers existing consumers. The official OpenTelemetry dependency is test-only.

Built with codex · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit c0ddac4 into issue-700 Oct 22, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-982 branch October 22, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant