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

Trace context isn't propagated through the interceptor #91

Closed
DustinJSilk opened this issue Mar 10, 2023 · 5 comments
Closed

Trace context isn't propagated through the interceptor #91

DustinJSilk opened this issue Mar 10, 2023 · 5 comments

Comments

@DustinJSilk
Copy link

DustinJSilk commented Mar 10, 2023

Hello,

I'm trying to receive a trace which seems to be picked up by the otel package, however, its missed by the Interceptor which then provides a new trace ID to the context.

I've added this to my project before creating the interceptor:

tc := propagation.NewCompositeTextMapPropagator(
  propagation.TraceContext{},
  propagation.Baggage{},
)
otel.SetTextMapPropagator(tc)

I'm passing a traceparent header and a tracestate header in my http request, from a Nodejs server.

The headers are recieved in my go server in the req.Headers interface. And when I step through the otel/propagation/trace_context.go extract function, the header is found and the correct IDs are returned but then not picked up by the interceptor.

Any guidance would be helpful!
Thanks

@DustinJSilk
Copy link
Author

I found the answer on Slack..

Adding otelconnect.WithTrustRemote() to the Interceptor solved the issue.
Hope this helps someone else.

Thanks

@akshayjshah
Copy link
Member

Glad you found the right answer! Also, there's more documentation here: https://connect.build/docs/go/observability#configuration-for-internal-microservices

@alehechka
Copy link

@akshayjshah, I ran into this same issue and was stuck for a while trying to figure out when my internal traces weren't connected after sending to Honeycomb. Glad I finally found this issue, adding that to the Interceptor fixed it.

I feel like that scenario is common enough, so is there any way that option could be called out/documented on the README here in this repo?

@akshayjshah
Copy link
Member

Definitely!

akshayjshah added a commit that referenced this issue Mar 29, 2023
Amend the README to include common gotchas (WithTrustRemote and
cardinality), and add a link to the docs on connect.build.

Addresses the comments on #91.
akshayjshah added a commit that referenced this issue Mar 29, 2023
Amend the README to include common gotchas (WithTrustRemote and
cardinality), and add a link to the docs on connect.build.

Addresses the comments on #91.
@akshayjshah
Copy link
Member

@alehechka and @DustinJSilk - updated the README in this repo to include documentation on WithTrustRemote, and also to link more obviously to the docs on https://connect.build. Thank you for bearing with us!

akshayjshah added a commit that referenced this issue Jul 26, 2023
Amend the README to include common gotchas (WithTrustRemote and
cardinality), and add a link to the docs on connect.build.

Addresses the comments on #91.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants