| Joey Armstrong | a6af152 | 2023-01-17 16:06:16 -0500 | [diff] [blame] | 1 | // Copyright The OpenTelemetry Authors |
| Abhay Kumar | a61c522 | 2025-11-10 07:32:50 +0000 | [diff] [blame] | 2 | // SPDX-License-Identifier: Apache-2.0 |
| Joey Armstrong | a6af152 | 2023-01-17 16:06:16 -0500 | [diff] [blame] | 3 | |
| Abhay Kumar | a61c522 | 2025-11-10 07:32:50 +0000 | [diff] [blame] | 4 | package otel // import "go.opentelemetry.io/otel" |
| Joey Armstrong | a6af152 | 2023-01-17 16:06:16 -0500 | [diff] [blame] | 5 | |
| Abhay Kumar | a61c522 | 2025-11-10 07:32:50 +0000 | [diff] [blame] | 6 | import ( |
| 7 | "go.opentelemetry.io/otel/internal/global" |
| 8 | "go.opentelemetry.io/otel/propagation" |
| 9 | ) |
| Joey Armstrong | a6af152 | 2023-01-17 16:06:16 -0500 | [diff] [blame] | 10 | |
| Abhay Kumar | a61c522 | 2025-11-10 07:32:50 +0000 | [diff] [blame] | 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() |
| Joey Armstrong | a6af152 | 2023-01-17 16:06:16 -0500 | [diff] [blame] | 15 | } |
| 16 | |
| Abhay Kumar | a61c522 | 2025-11-10 07:32:50 +0000 | [diff] [blame] | 17 | // SetTextMapPropagator sets propagator as the global TextMapPropagator. |
| 18 | func SetTextMapPropagator(propagator propagation.TextMapPropagator) { |
| 19 | global.SetTextMapPropagator(propagator) |
| Joey Armstrong | a6af152 | 2023-01-17 16:06:16 -0500 | [diff] [blame] | 20 | } |