Skip to content

The OTLP JSON Lines writer #982

Closed
Closed

Description

@JacobStephens2

Parent

#700

What to build

A module that writes OpenTelemetry log records and spans as OTLP JSON Lines, and reads them back, for Session traces and for anyone else who wants it. It knows nothing of thirdshift, so its interface uses no thirdshift type and it could later move into a crate of its own, under a name without "opentelemetry" or "otel".

  • Each line is one export request: resourceLogs in a file of log records, resourceSpans in a file of spans. A file never holds both, as the OTLP file format requires.
  • It follows OTLP's JSON encoding rules: trace and span IDs in hex, enums as numbers, camelCase keys, and 64-bit integers as strings.
  • It covers what Session traces need: resources and scopes, every attribute value type, and log records with their trace ID, span ID, times, severity, event name, body and attributes. For spans, that means their parent, kind, status, events and attributes.
  • It adds no dependency at run time. It's built on the serde thirdshift already uses.

See #700's "The OTLP writer" decisions, and the OTLP file-writer research note.

Acceptance criteria

  • Log records and spans written by the module decode with OpenTelemetry's official protocol types, a test-only dependency, to the same values, and the module reads them back unchanged.
  • The OTLP specification's JSON examples read back to the values they show.
  • IDs, enums, keys and 64-bit integers follow the encoding rules, each with a test.
  • No new run-time dependency, and no thirdshift type in the module's interface.
  • A one-time check that the OpenTelemetry Collector's file receiver reads files the module wrote is recorded, with its result, in the OTLP file-writer research note.

Activity

  1. added
    ready-for-agent
    on Oct 21, 2026
  2. JacobStephens2 commented on Oct 22, 2026

    @JacobStephens2
    OwnerAuthor

    Closed by #1048, merged into issue-700 by a thirdshift Merge run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions