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

opentracing: allow customizing propagator headers #155

Merged
merged 1 commit into from
Jan 19, 2018

Conversation

gbbr
Copy link
Contributor

@gbbr gbbr commented Jan 19, 2018

This change introduces the possibility of customizing the opentracing.TextMap propagator that is used in the tracer. A default implementation is provided which exposes a constructor that allows configuring the headers used when attaching values into the map.

Feature

If users would want to override the default TextMap propagator, an example configuration could be:

cfg := ddtrace.NewConfiguration()
cfg.TextPropagator = ddtrace.NewTextMapPropagator("ot-baggage-", "x-trace-id", "x-parent-id")

This will prefix all baggage header keys with "ot-baggage-" and will define trace and parent map keys as "x-trace-id" and "x-parent-id".

@gbbr gbbr requested a review from palazzem January 19, 2018 00:12
@gbbr gbbr added this to the 0.6.1 milestone Jan 19, 2018
@gbbr gbbr force-pushed the gbbr/propagator-headers branch 2 times, most recently from 51de369 to e9e6857 Compare January 19, 2018 14:41
@gbbr gbbr force-pushed the gbbr/propagator-headers branch 3 times, most recently from 728f61d to 73ac71d Compare January 19, 2018 14:56
Copy link
Contributor

@palazzem palazzem left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you very much!

@palazzem palazzem merged commit 2761701 into master Jan 19, 2018
@palazzem palazzem deleted the gbbr/propagator-headers branch January 19, 2018 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants