googleapis / googleapis/google-cloud-node

Add W3C Baggage support in telemetry-tracing

Open
#8,046 0 comments 0 reactions 0 assignees View on GitHub
type: feature request
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.