propagation.go 636 B

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