From 3a369fb3dd63039b798183196af7d6cb0359eb27 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 31 Oct 2024 09:44:25 +0000 Subject: [PATCH] Tracing: use events for http client detail otelhttptrace shows the time to do DNS, get a connection, etc. By default it does these as sub-spans, but I think it's better to do them as events. Smaller volume of data and easier to view on screen. Signed-off-by: Bryan Boreham --- tracing/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracing/http.go b/tracing/http.go index 00305173c7..a5832de7e4 100644 --- a/tracing/http.go +++ b/tracing/http.go @@ -30,7 +30,7 @@ import ( func Transport(rt http.RoundTripper, name string) http.RoundTripper { rt = otelhttp.NewTransport(rt, otelhttp.WithClientTrace(func(ctx context.Context) *httptrace.ClientTrace { - return otelhttptrace.NewClientTrace(ctx) + return otelhttptrace.NewClientTrace(ctx, otelhttptrace.WithoutSubSpans()) }), otelhttp.WithSpanNameFormatter(func(_ string, r *http.Request) string { return name + "/HTTP " + r.Method