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

propagator configuration needs better shorthand #1265

Closed
lizthegrey opened this issue Oct 19, 2020 · 3 comments · Fixed by open-telemetry/opentelemetry-go-contrib#2258
Closed
Labels
area:propagators Part of OpenTelemetry context propagation enhancement New feature or request pkg:API Related to an API package
Milestone

Comments

@lizthegrey
Copy link
Member

global.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{}))

is impossible for a new user to figure out on their own, and is a magic incantation we should give a mnemonic if we don't just make it the default.

@Aneurysm9
Copy link
Member

Agreed. Unfortunately, the spec now requires no-op default propagators. Perhaps we should have a function in the propagators package that returns a composite propagator with TraceContext and Baggage.

@lizthegrey
Copy link
Member Author

agree, a composite out of box propagator would be helpful to have a util function for.

@MrAlias MrAlias added area:propagators Part of OpenTelemetry context propagation pkg:API Related to an API package priority:p3 labels Oct 29, 2020
@MrAlias MrAlias added this to the RC1 milestone Oct 29, 2020
@seanschade
Copy link
Contributor

I will give you my experience from a user's point of view. I implemented this yesterday in one of our shared libraries and found it to be quite intuitive.

We plan to create one or more custom propagators, and otel.NewCompositeTextMapPropagator(...) is an easy way to set them when initializing the telemetry. I created a map to help parse the OTEL_PROPAGATORS environment variable and set the global propagators.

var SupportedTextMapPropagators = map[string]otel.TextMapPropagator{
		"baggage":      propagators.Baggage{},
		"tracecontext": propagators.TraceContext{},
		"b3":           b3.B3{},
		"jaeger":       jaeger.Jaeger{},
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:propagators Part of OpenTelemetry context propagation enhancement New feature or request pkg:API Related to an API package
Projects
None yet
5 participants