propagation.go

 1// Copyright The OpenTelemetry Authors
 2// SPDX-License-Identifier: Apache-2.0
 3
 4package otel // import "go.opentelemetry.io/otel"
 5
 6import (
 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.
13func GetTextMapPropagator() propagation.TextMapPropagator {
14	return global.TextMapPropagator()
15}
16
17// SetTextMapPropagator sets propagator as the global TextMapPropagator.
18func SetTextMapPropagator(propagator propagation.TextMapPropagator) {
19	global.SetTextMapPropagator(propagator)
20}