GoogleCloudPlatform / opentelemetry-operations-java

Apache License 2.0
71 stars 41 forks source link

Accept the x-cloud-trace-context header even without the trace flag field. #351

Closed sawadakaku closed 3 months ago

sawadakaku commented 3 months ago

Hello, teams,

It seems that Java's propagator only accepts the x-cloud-trace-context header in the format of "trace_id/span_id;o=flag As per other language implementations, the propagator should accept x-cloud-trace-context even if it lacks o=<sampled>.

I found a similar issue reported in the Python repository.

javascript: https://github.com/GoogleCloudPlatform/opentelemetry-operations-js/blob/3a037e10210d7c8ade24520e594f79e2a4f6384b/packages/opentelemetry-cloud-trace-propagator/src/CloudPropagator.ts#L74 python: https://github.com/muncus/opentelemetry-operations-python/blob/06daffa21fd7c39baaca2b160f5944770fc42194/opentelemetry-propagator-gcp/src/opentelemetry/propagators/cloud_trace_propagator/__init__.py#L25 golang: https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/51ae889905856aae5af664e7168349f7d96bc95f/propagator/propagator.go#L36

I've prepared a pull request to resolve this issue.

aabmass commented 3 months ago

@psx95 is taking a look at your PR

psx95 commented 3 months ago

Merged #350