open-telemetry / opentelemetry-go-instrumentation

OpenTelemetry Auto Instrumentation using eBPF
https://opentelemetry.io
Apache License 2.0
532 stars 81 forks source link

context propagation does not work with http #79

Open JamieDanielson opened 1 year ago

JamieDanielson commented 1 year ago

Describe the bug

Context propagation does not work with http; a new trace id is created each request instead of a distributed trace.

Environment

To Reproduce

Steps to reproduce the behavior:

See example app using this, where events show up but are not a distributed trace. I am using OTEL_PROPAGATORS with values of "tracecontext,baggage".

egs-separate-trace-ids

Expected behavior

The spans are connected in a distributed trace with the same trace id.

MikeGoldsmith commented 1 year ago

I'm looking into this now.

It doesn't look like request headers are read in the ServerMux_ServeHTTP and there isn't a probe configured to write HTTP headers for outbound requests.

vreynolds commented 1 year ago

It looks like there were 2 open PRs that addressed this in the OG key-val repo: https://github.com/keyval-dev/opentelemetry-go-instrumentation/pull/49/ and https://github.com/keyval-dev/opentelemetry-go-instrumentation/pull/50/

mayanksingh2298 commented 1 year ago

Hey, any update on this? Are we integrating these MRs in this repo?

MikeGoldsmith commented 1 year ago

Hey, any update on this? Are we integrating these MRs in this repo?

Hey @mayanksingh2298 - yes, @oxeye-gal ported their PRs over in #91 & #92. Once merged, propagation should be working.

damemi commented 1 year ago

Maybe relevant -- ? https://github.com/open-telemetry/opentelemetry-go-instrumentation/issues/220

zengyuxing007 commented 1 year ago

You can try this mirror to see if it can solve your problem.

vifoggy/otel-go-instrumentation:v0.2.2-alpha