propagation.go raw
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package otel // import "go.opentelemetry.io/otel"
5
6 import (
7 "go.opentelemetry.io/otel/internal/global"
8 "go.opentelemetry.io/otel/propagation"
9 )
10
11 // GetTextMapPropagator returns the global TextMapPropagator. If none has been
12 // set, a No-Op TextMapPropagator is returned.
13 func GetTextMapPropagator() propagation.TextMapPropagator {
14 return global.TextMapPropagator()
15 }
16
17 // SetTextMapPropagator sets propagator as the global TextMapPropagator.
18 func SetTextMapPropagator(propagator propagation.TextMapPropagator) {
19 global.SetTextMapPropagator(propagator)
20 }
21