Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing force tracing with Jaeger #4918

Merged
merged 2 commits into from Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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.
squat marked this conversation as resolved.
Show resolved Hide resolved

### Changed

Expand Down
3 changes: 2 additions & 1 deletion pkg/tracing/http.go
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"net/http"
"strconv"
"strings"

"github.com/go-kit/log"
"github.com/go-kit/log/level"
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion pkg/tracing/jaeger/jaeger.go
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"io"
"strings"

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

Expand Down Expand Up @@ -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(
Expand Down