Trace context is not propagating to the http request (using NewRequestWithContext) #2074
-
Hi, I am using otelecho.Middleware to trace my request from service1(in go) to service2(in java) Please see my code below
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I got the answer for my query client := http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)} |
Beta Was this translation helpful? Give feedback.
-
For any future readers struggling with this, you MUST use |
Beta Was this translation helpful? Give feedback.
I got the answer for my query
Need to use client like below
client := http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
req, _ := http.NewRequestWithContext(ctx, "GET", url, nil)