blob: 2fd9497338ffae6fba09548cea07603f8a28c08f [file] [log] [blame]
Joey Armstrong5f51f2e2023-01-17 17:06:26 -05001// Copyright The OpenTelemetry Authors
Abhay Kumara2ae5992025-11-10 14:02:24 +00002// SPDX-License-Identifier: Apache-2.0
Joey Armstrong5f51f2e2023-01-17 17:06:26 -05003
Abhay Kumara2ae5992025-11-10 14:02:24 +00004package otel // import "go.opentelemetry.io/otel"
Joey Armstrong5f51f2e2023-01-17 17:06:26 -05005
Abhay Kumara2ae5992025-11-10 14:02:24 +00006import (
7 "go.opentelemetry.io/otel/internal/global"
8 "go.opentelemetry.io/otel/propagation"
9)
Joey Armstrong5f51f2e2023-01-17 17:06:26 -050010
Abhay Kumara2ae5992025-11-10 14:02:24 +000011// 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()
Joey Armstrong5f51f2e2023-01-17 17:06:26 -050015}
16
Abhay Kumara2ae5992025-11-10 14:02:24 +000017// SetTextMapPropagator sets propagator as the global TextMapPropagator.
18func SetTextMapPropagator(propagator propagation.TextMapPropagator) {
19 global.SetTextMapPropagator(propagator)
Joey Armstrong5f51f2e2023-01-17 17:06:26 -050020}