You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-23 22:34:47 +02:00
21 lines
474 B
Go
21 lines
474 B
Go
|
|
// Copyright The OpenTelemetry Authors
|
||
|
|
// SPDX-License-Identifier: Apache-2.0
|
||
|
|
|
||
|
|
package propagation_test
|
||
|
|
|
||
|
|
import (
|
||
|
|
"go.opentelemetry.io/otel"
|
||
|
|
"go.opentelemetry.io/otel/propagation"
|
||
|
|
)
|
||
|
|
|
||
|
|
func ExampleSetTextMapPropagator() {
|
||
|
|
// Create a new composite text map propagator.
|
||
|
|
propagator := propagation.NewCompositeTextMapPropagator(
|
||
|
|
propagation.TraceContext{},
|
||
|
|
propagation.Baggage{},
|
||
|
|
)
|
||
|
|
|
||
|
|
// Set it as the global text map propagator.
|
||
|
|
otel.SetTextMapPropagator(propagator)
|
||
|
|
}
|