Skip to content

Commit

Permalink
document why we use our own option
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed May 14, 2024
1 parent f4cf5c0 commit 69ece88
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func main() {
client := http.Client{
Transport: otelhttp.NewTransport(
http.DefaultTransport,
// By setting the otelhttptrace client in this transport, it can be
// injected into the context after the span is started, which makes the
// httptrace spans childs of the transport one.
otelhttp.WithClientTrace(func(ctx context.Context) *httptrace.ClientTrace {
return otelhttptrace.NewClientTrace(ctx)
}),
Expand Down

0 comments on commit 69ece88

Please sign in to comment.