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

Tracing: change baggage key to be lower kebab-case for Jaeger compatability #4018

Closed
wants to merge 3 commits into from
Closed

Tracing: change baggage key to be lower kebab-case for Jaeger compatability #4018

wants to merge 3 commits into from

Conversation

conorevans
Copy link
Contributor

@conorevans conorevans commented Apr 4, 2021

Signed-off-by: Conor Evans coevans@tcd.ie

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Closes #3951

Changes

Make baggage key lowercase for Jaeger support. Per Jaeger documentation:

Limitation: since HTTP headers don’t preserve the case, Jaeger recommends baggage keys to be lowercase-kebab-case, e.g. my-baggage-key-1.

Verification

Since this is a one-line const change, no tests have been added. I also did not feel terribly inclined to spin up a local Thanos+Jaeger set-up, though I can do so for completeness if desired.

…ability

Signed-off-by: Conor Evans <coevans@tcd.ie>
Signed-off-by: Conor Evans <coevans@tcd.ie>
Signed-off-by: Conor Evans <coevans@tcd.ie>
@conorevans conorevans changed the title Tracing: change baggage key to be lower kebab-cae for Jaeger compatability Tracing: change baggage key to be lower kebab-case for Jaeger compatability Apr 4, 2021
const ForceTracingBaggageKey = "X-Thanos-Force-Tracing"
// Lower kebab-case for Jaeger support, per documentation:
// https://www.jaegertracing.io/docs/1.22/client-libraries/#baggage
const ForceTracingBaggageKey = "x-thanos-force-tracing"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder.. can we maybe support both? It will not introduce breaking change for user too. Just let's lower case the input before checking?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but I wasn't sure I saw the benefit - now I think further, backwards compatibility is preferable, for sure.

I'm not 100% sure I'm envisioning it right, so I'll just check. In pkg/tracing/http.go

// If client specified ForceTracingBaggageKey header, ensure span includes it to force tracing.
span.SetBaggageItem(ForceTracingBaggageKey, r.Header.Get(ForceTracingBaggageKey))

here we'd set to span.SetBaggageItem(strings.ToLower(ForceTracingBaggageKey),...

Then set the JaegerDebugHeader in pkg/tracing/jaeger/jaeger.go to ToLower as well.

The only other place I can see that is a forceRecorder in pkg/tracing/stackdriver/tracer.go which itself is used for a basic tracer wrapping a gcloud tracer, so I don't see it necessary there?

@stale
Copy link

stale bot commented Jun 12, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jun 12, 2021
@stale stale bot closed this Jun 20, 2021
@deniszh deniszh mentioned this pull request Dec 1, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jaeger ForceTracing not work
2 participants