Open colega opened 9 months ago
I called config.Configuration.InitGlobalTracer(...) after replacing the http.DefaultTransport with a custom implementation, and it panicked.
config.Configuration.InitGlobalTracer(...)
http.DefaultTransport
The code assumes that http.DefaultTransport is a *http.Transport, and panics otherwise:
*http.Transport
https://github.com/jaegertracing/jaeger-client-go/blob/8d8e8fcfd04de42b8482476abac6a902fca47c18/sampler_remote.go#L308
config.Configuration.InitGlobalTracer()
Example: https://go.dev/play/p/TH-uFyyMuLD
package main import ( "fmt" "net/http" "github.com/uber/jaeger-client-go/config" ) func main() { http.DefaultTransport = &customTransport{&http.Transport{}} closer, err := config.Configuration{}.InitGlobalTracer("hello-world") if err != nil { panic(fmt.Errorf("failed: %w", err)) } defer closer.Close() fmt.Println("Hello, 世界") } type customTransport struct { next http.RoundTripper } func (ct *customTransport) RoundTrip(req *http.Request) (*http.Response, error) { return ct.next.RoundTrip(req) }
It shouldn't panic.
No response
What happened?
I called
config.Configuration.InitGlobalTracer(...)
after replacing thehttp.DefaultTransport
with a custom implementation, and it panicked.The code assumes that
http.DefaultTransport
is a*http.Transport
, and panics otherwise:https://github.com/jaegertracing/jaeger-client-go/blob/8d8e8fcfd04de42b8482476abac6a902fca47c18/sampler_remote.go#L308
Steps to reproduce
http.DefaultTransport
value in your app.config.Configuration.InitGlobalTracer()
Example: https://go.dev/play/p/TH-uFyyMuLD
Expected behavior
It shouldn't panic.
Relevant log output
No response
Screenshot
No response
Additional context
No response
Jaeger backend version
No response
SDK
No response
Pipeline
No response
Stogage backend
No response
Operating system
No response
Deployment model
No response
Deployment configs
No response