Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCensusBridge doesn't propagate TraceState between OCSpan and OTelSpan #5642

Closed
jianwu opened this issue Jul 24, 2024 · 0 comments
Closed
Labels
bug Something isn't working pkg:bridges Related to a bridge package
Milestone

Comments

@jianwu
Copy link
Contributor

jianwu commented Jul 24, 2024

Description

When a SPAN is created by OC Tracer and started with a remote parent which include TraceState values, the TraceState won't be persisted when OpenCensusBridge is enabled. Due to the following logic didn't copy the tracestate back and forth.

Environment

  • OS: MacOS
  • Architecture: M1
  • Go Version: go1.22.3
  • opentelemetry-go version: v1.28.0

Steps To Reproduce

  1. Setup a grpc server app with proper OpenCensus server interceptor to decode w3c trace context headers,
  2. Enable Bridge by calling:
    opencensus.InstallTraceBridge()
  3. Issue an grpc request using grpcui with tracestate header.
  4. In the grpc server handler logic, dump the tracestate in the span.
  5. The tracestate is nil.

Expected behavior

TraceState should be propagated as passed in the grpc tracestate header

A clear and concise description of what you expected to happen.
This is due the code:


Also the reverse conversion in package otel2oc
It didn't propagate tracestate information.

@jianwu jianwu added the bug Something isn't working label Jul 24, 2024
@pellared pellared added the pkg:bridges Related to a bridge package label Jul 25, 2024
dmathieu pushed a commit that referenced this issue Aug 21, 2024
# Summary 
This is to fix issue: #5642 
The original logic skips copying TraceState when convert Spans between
OTel and OC.

This PR also updated the OTel TraceState to expose the Keys function for
the propagation purpose.

---------

Co-authored-by: Sam Xie <sam@samxie.me>
@jianwu jianwu closed this as completed Oct 7, 2024
@XSAM XSAM added this to the untracked milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:bridges Related to a bridge package
Projects
None yet
Development

No branches or pull requests

3 participants