-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
I tried to set up our application so that all outbound HTTP requests would produce OTel traces.
Specifically, I added this code to our initialization logic:
http.DefaultTransport = otelhttp.NewTransport(http.DefaultTransport)
Unfortunately, this led to panics from idtoken.NewClient()
, due to this code:
httpTransport := http.DefaultTransport.(*http.Transport).Clone()
httpTransport.MaxIdleConnsPerHost = 100
Given the fact that http.DefaultTransport
has type http.RoundTripper
(an interface) and not *http.Transport
(a concrete type), I think this code should be doing more cautious type-checking to avoid panics here.
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.