diff --git a/CHANGELOG.md b/CHANGELOG.md index 0022e8d6f4..abd540da48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#4779](https://github.com/thanos-io/thanos/pull/4779) Examples: Fix the interactive test for MacOS users. - [#4792](https://github.com/thanos-io/thanos/pull/4792) Store: Fix data race in BucketedBytes pool. - [#4769](https://github.com/thanos-io/thanos/pull/4769) Query-frontend+api: add "X-Request-ID" field and other fields to start call log. +- [#4918](https://github.com/thanos-io/thanos/pull/4918) Tracing: Fixing force tracing with Jaeger. ### Changed diff --git a/pkg/tracing/http.go b/pkg/tracing/http.go index 2fc215a034..bb906eb54a 100644 --- a/pkg/tracing/http.go +++ b/pkg/tracing/http.go @@ -8,6 +8,7 @@ import ( "net" "net/http" "strconv" + "strings" "github.com/go-kit/log" "github.com/go-kit/log/level" @@ -35,7 +36,7 @@ func HTTPMiddleware(tracer opentracing.Tracer, name string, logger log.Logger, n ext.HTTPUrl.Set(span, r.URL.String()) // If client specified ForceTracingBaggageKey header, ensure span includes it to force tracing. - span.SetBaggageItem(ForceTracingBaggageKey, r.Header.Get(ForceTracingBaggageKey)) + span.SetBaggageItem(strings.ToLower(ForceTracingBaggageKey), r.Header.Get(ForceTracingBaggageKey)) if t, ok := tracer.(Tracer); ok { if traceID, ok := t.GetTraceIDFromSpanContext(span.Context()); ok { diff --git a/pkg/tracing/jaeger/jaeger.go b/pkg/tracing/jaeger/jaeger.go index d071405e94..7a33d7d8a7 100644 --- a/pkg/tracing/jaeger/jaeger.go +++ b/pkg/tracing/jaeger/jaeger.go @@ -7,6 +7,7 @@ import ( "context" "fmt" "io" + "strings" "github.com/thanos-io/thanos/pkg/tracing" @@ -52,7 +53,7 @@ func NewTracer(ctx context.Context, logger log.Logger, metrics *prometheus.Regis } cfg.Headers = &jaeger.HeadersConfig{ - JaegerDebugHeader: tracing.ForceTracingBaggageKey, + JaegerDebugHeader: strings.ToLower(tracing.ForceTracingBaggageKey), } cfg.Headers.ApplyDefaults() jaegerTracer, closer, err = cfg.NewTracer(