| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package propagation_test |
| 5 |
|
| 6 |
import ( |
| 7 |
"go.opentelemetry.io/otel" |
| 8 |
"go.opentelemetry.io/otel/propagation" |
| 9 |
) |
| 10 |
|
| 11 |
func ExampleSetTextMapPropagator() { |
| 12 |
// Create a new composite text map propagator. |
| 13 |
propagator := propagation.NewCompositeTextMapPropagator( |
| 14 |
propagation.TraceContext{}, |
| 15 |
propagation.Baggage{}, |
| 16 |
) |
| 17 |
|
| 18 |
// Set it as the global text map propagator. |
| 19 |
otel.SetTextMapPropagator(propagator) |
| 20 |
} |