opentelemetry-go-instrumentation icon indicating copy to clipboard operation
opentelemetry-go-instrumentation copied to clipboard

context propagation does not work with http

Open JamieDanielson opened this issue 1 year ago • 6 comments

Describe the bug

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

Environment

  • OS: kind/k8s 1.26 on mac/docker
  • Go Version: 1.20
  • Version: docker image built with latest commit 859307d

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.

JamieDanielson avatar Apr 14 '23 23:04 JamieDanielson

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.

MikeGoldsmith avatar Apr 17 '23 11:04 MikeGoldsmith

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/

vreynolds avatar Apr 17 '23 23:04 vreynolds

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

mayanksingh2298 avatar Apr 21 '23 15:04 mayanksingh2298

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.

MikeGoldsmith avatar May 03 '23 09:05 MikeGoldsmith

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

damemi avatar Jul 11 '23 18:07 damemi

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

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

zengyuxing007 avatar Oct 27 '23 07:10 zengyuxing007