Skip to content

Commit c0a3f14

Browse files
deniszhDenys Zhdanov
andauthored
Fixing force tracing with Jaeger (#4918)
* lowering ForceTracingBaggageKey to work with Jaeger Signed-off-by: Denys Zhdanov <[email protected]> * Adding CHANGELOG entry Signed-off-by: Denys Zhdanov <[email protected]> fixing formatting Signed-off-by: Denys Zhdanov <[email protected]> fixing formatting Co-authored-by: Denys Zhdanov <[email protected]>
1 parent d08a12a commit c0a3f14

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
4040
- [#4779](https://github.com/thanos-io/thanos/pull/4779) Examples: Fix the interactive test for MacOS users.
4141
- [#4792](https://github.com/thanos-io/thanos/pull/4792) Store: Fix data race in BucketedBytes pool.
4242
- [#4769](https://github.com/thanos-io/thanos/pull/4769) Query-frontend+api: add "X-Request-ID" field and other fields to start call log.
43+
- [#4918](https://github.com/thanos-io/thanos/pull/4918) Tracing: Fixing force tracing with Jaeger.
4344

4445
### Changed
4546

pkg/tracing/http.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net"
99
"net/http"
1010
"strconv"
11+
"strings"
1112

1213
"github.com/go-kit/log"
1314
"github.com/go-kit/log/level"
@@ -35,7 +36,7 @@ func HTTPMiddleware(tracer opentracing.Tracer, name string, logger log.Logger, n
3536
ext.HTTPUrl.Set(span, r.URL.String())
3637

3738
// If client specified ForceTracingBaggageKey header, ensure span includes it to force tracing.
38-
span.SetBaggageItem(ForceTracingBaggageKey, r.Header.Get(ForceTracingBaggageKey))
39+
span.SetBaggageItem(strings.ToLower(ForceTracingBaggageKey), r.Header.Get(ForceTracingBaggageKey))
3940

4041
if t, ok := tracer.(Tracer); ok {
4142
if traceID, ok := t.GetTraceIDFromSpanContext(span.Context()); ok {

pkg/tracing/jaeger/jaeger.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"context"
88
"fmt"
99
"io"
10+
"strings"
1011

1112
"github.com/thanos-io/thanos/pkg/tracing"
1213

@@ -52,7 +53,7 @@ func NewTracer(ctx context.Context, logger log.Logger, metrics *prometheus.Regis
5253
}
5354

5455
cfg.Headers = &jaeger.HeadersConfig{
55-
JaegerDebugHeader: tracing.ForceTracingBaggageKey,
56+
JaegerDebugHeader: strings.ToLower(tracing.ForceTracingBaggageKey),
5657
}
5758
cfg.Headers.ApplyDefaults()
5859
jaegerTracer, closer, err = cfg.NewTracer(

0 commit comments

Comments
 (0)