-
Notifications
You must be signed in to change notification settings - Fork 438
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
[BUG] unable to extract traceparent
header
#2494
Labels
bug
unintended behavior that has to be fixed
Comments
github-actions
bot
added
the
needs-triage
New issues that have not yet been triaged
label
Jan 9, 2024
@tylerbrewer2 How is your |
Here are my headers:
|
@tylerbrewer2 I just tested it in our current main branch, and it seems to work. func TestHTTPHeadersCarrierExtract(t *testing.T) {
tracer := newTracer()
internal.SetGlobalTracer(tracer)
defer tracer.Stop()
r := &http.Request{
Header: http.Header{
"Sec-Fetch-Mode": []string{"cors"},
"Accept-Encoding": []string{"gzip, deflate"},
"Content-Length": []string{"0"},
"Host": []string{"127.0.0.1:8090"},
"Connection": []string{"keep-alive"},
"Traceparent": []string{"00-e73ce4a976cb18ac8d648239cc60e26f-ee91c28519b9f401-01"},
"Accept": []string{"*/*"},
"Content-Type": []string{"application/proto"},
"Accept-Language": []string{"*"},
"User-Agent": []string{"undici"},
},
}
header := HTTPHeadersCarrier(r.Header)
sCtx, _ := Extract(header)
span := StartSpan("operation", ChildOf(sCtx))
assertions := assert.New(t)
sp, ok := span.Context().(ddtrace.SpanContextW3C)
assertions.True(ok)
assertions.NotZero(sp.TraceID128())
t.Logf("traceID: %s", sp.TraceID128())
} Do you observe any difference between my example and your code? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm attempting to create a span from an Opentelemetry trace id using the ddtrace Go library. It doesn't look like the library is parsing my
traceparent
header correctly. I've searched for more documentation around this and couldnt find any, although I could be missing it.Here is my simplified code:
And here is an example
traceparent
header:00-5561fab7902a8debd3e3ae2dd534e52d-824e6ffb17187dcd-00
Version of dd-trace-go
1.59.0
Describe what happened:
The created span is not associated with the parent span.
Describe what you expected:
The created span to be associated with the parent span.
The text was updated successfully, but these errors were encountered: