Skip to content

feat(transcode): propagate W3C trace-context and request deadlines to gRPC #31

Description

@polaz

Observability gap: a request's trace and deadline don't cross the REST→gRPC boundary, so traces split and client deadlines aren't honored upstream.

Scope

  • Trace-context (W3C): forward incoming traceparent (+ tracestate) into gRPC metadata. When no traceparent is present, synthesize one (random 16-byte trace-id + 8-byte span-id, sampled) so the upstream still joins a single trace across the boundary.
  • Deadline: when the request carries a gRPC-format grpc-timeout header (<int><unit> with unit H/M/S/m/u/n), parse it and set it as the upstream call deadline via tonic's request timeout. Absent → the channel default applies.

Applies to both unary and server-streaming transcoding paths.

Acceptance

  • Unit tests: traceparent forward vs synthesize (valid W3C format), tracestate forwarding, grpc-timeout parsing per unit + overflow rejection.
  • README: note trace-context + deadline propagation under Features.

Estimate: 5h

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions