You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-27 22:49:15 +02:00
Merge propagation and api/propagation into api/propagators (#362)
* Merge propagation Rename and merge propagation and api/propagation to api/propagators. Drop propagator suffix in general such that TextFormatPropagator becomes TextFormat since usage is propagators.TextFormat fixes #311 * Rebase and godoc updates * Revert go mod changes * Replace carrier with supplier in godoc
This commit is contained in:
@@ -20,9 +20,8 @@ import (
|
||||
|
||||
"go.opentelemetry.io/otel/api/core"
|
||||
"go.opentelemetry.io/otel/api/global"
|
||||
"go.opentelemetry.io/otel/api/propagation"
|
||||
"go.opentelemetry.io/otel/api/propagators"
|
||||
"go.opentelemetry.io/otel/api/trace"
|
||||
prop "go.opentelemetry.io/otel/propagation"
|
||||
)
|
||||
|
||||
var _ http.Handler = &Handler{}
|
||||
@@ -51,7 +50,7 @@ type Handler struct {
|
||||
handler http.Handler
|
||||
|
||||
tracer trace.Tracer
|
||||
prop propagation.TextFormatPropagator
|
||||
prop propagators.TextFormat
|
||||
spanOptions []trace.SpanOption
|
||||
public bool
|
||||
readEvent bool
|
||||
@@ -80,8 +79,8 @@ func WithPublicEndpoint() Option {
|
||||
|
||||
// WithPropagator configures the Handler with a specific propagator. If this
|
||||
// option isn't specificed then
|
||||
// go.opentelemetry.io/otel/propagation.TraceContextPropagator is used.
|
||||
func WithPropagator(p propagation.TextFormatPropagator) Option {
|
||||
// go.opentelemetry.io/otel/api/propagators.TraceContext is used.
|
||||
func WithPropagator(p propagators.TextFormat) Option {
|
||||
return func(h *Handler) {
|
||||
h.prop = p
|
||||
}
|
||||
@@ -131,7 +130,7 @@ func NewHandler(handler http.Handler, operation string, opts ...Option) http.Han
|
||||
h := Handler{handler: handler, operation: operation}
|
||||
defaultOpts := []Option{
|
||||
WithTracer(global.TraceProvider().Tracer("go.opentelemetry.io/plugin/othttp")),
|
||||
WithPropagator(prop.TraceContextPropagator{}),
|
||||
WithPropagator(propagators.TraceContext{}),
|
||||
WithSpanOptions(trace.WithSpanKind(trace.SpanKindServer)),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user