Skip to content

Add W3C Baggage support in telemetry-tracing #8046

@aris-cub

Description

@aris-cub

Library Name

@google-cloud/pubsub

A screenshot that you have tested with "Try this API".

The telemetry-tracing module currently uses only W3CTraceContextPropagator, which propagates traceparent and tracestate headers but not W3C Baggage (https://www.w3.org/TR/baggage/). This means arbitrary key-value metadata cannot flow through Pub/Sub messages.

What would you like to see in the library?

Add W3C Baggage propagation to Pub/Sub messages, so that googclient_baggage is injected/extracted alongside the existing googclient_traceparent.

Describe alternatives you've considered

Implementing baggage propagation at the application level rather than in the client library. However, this would require every consumer to duplicate the same propagation logic manually, which is error-prone and inconsistent with how trace context is already handled

Additional context/notes

  • All required classes (W3CBaggagePropagator, CompositePropagator) are already available in the existing @opentelemetry/core dependency.

  • No new production dependencies are needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions