This repository was archived by the owner on May 23, 2024. It is now read-only.

Description
What happened?
I called config.Configuration.InitGlobalTracer(...) after replacing the http.DefaultTransport with a custom implementation, and it panicked.
The code assumes that http.DefaultTransport is a *http.Transport, and panics otherwise:
|
customTransport := http.DefaultTransport.(*http.Transport).Clone() |
Steps to reproduce
- Replace
http.DefaultTransport value in your app.
- Call
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)
}
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