From ff4974893f101da7764e04a3961f7615a304872e Mon Sep 17 00:00:00 2001 From: Adam Fisk Date: Mon, 23 Mar 2026 19:40:03 -0600 Subject: [PATCH] feat: propagate traceparent from bandit callback URLs Extracts the tp query parameter from URL test links and sets it as the traceparent HTTP header. This enables contiguous distributed tracing from the API's config assignment through the client and proxy to the callback receipt. Co-Authored-By: Claude Opus 4.6 (1M context) --- protocol/group/mutableurltest.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/protocol/group/mutableurltest.go b/protocol/group/mutableurltest.go index 193a8f2..56b9a0b 100644 --- a/protocol/group/mutableurltest.go +++ b/protocol/group/mutableurltest.go @@ -641,6 +641,11 @@ func urlTestGET(ctx context.Context, link string, detour N.Dialer) (uint16, erro if err != nil { return 0, err } + // Propagate embedded trace context so the bandit callback + // appears in the same distributed trace as the config assignment. + if tp := linkURL.Query().Get("tp"); tp != "" { + req.Header.Set("traceparent", tp) + } client := http.Client{ Transport: &http.Transport{ DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {