From 98fbae0192b909a0e02ef1d9aec1f29cdad31817 Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Fri, 18 Sep 2020 07:30:26 -0700 Subject: [PATCH] Change default propagator in unconfigured API (#930) --- CHANGELOG.md | 2 ++ specification/context/api-propagators.md | 31 ++++++++++++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da2409a8cda..189b8492bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ release. New: +- Default propagators in un-configured API must be no-op + ([#930](https://github.com/open-telemetry/opentelemetry-specification/pull/930)). - Define resource mapping for Jaeger exporters ([#891](https://github.com/open-telemetry/opentelemetry-specification/pull/891)) - Add resource semantic conventions for operating systems diff --git a/specification/context/api-propagators.md b/specification/context/api-propagators.md index 654dd21e88c..17aff8f1eb5 100644 --- a/specification/context/api-propagators.md +++ b/specification/context/api-propagators.md @@ -267,14 +267,29 @@ Required arguments: ## Global Propagators -Implementations MAY provide global `Propagator`s for -each supported `Propagator` type. - -If offered, the global `Propagator`s should default to a composite `Propagator` -containing the W3C Trace Context Propagator and the Baggage `Propagator` -specified in [api-baggage.md](../baggage/api.md#serialization), -in order to provide propagation even in the presence of no-op -OpenTelemetry implementations. +The OpenTelemetry API MUST provide a way to obtain a propagator for each +supported `Propagator` type. Instrumentation libraries SHOULD call propagators +to extract and inject the context on all remote calls. Propagators, depending on +the language, MAY be set up using various dependency injection techniques or +available as global accessors. + +**Note:** It is a discouraged practice, but certain instrumentation libraries +might use proprietary context propagation protocols or be hardcoded to use a +specific one. In such cases, instrumentation libraries MAY choose not to use the +API-provided propagators and instead hardcode the context extraction and injection +logic. + +The OpenTelemetry API MUST use no-op propagators unless explicitly configured +otherwise. Context propagation may be used for various telemetry signals - +traces, metrics, logging and more. Therefore, context propagation MAY be enabled +for any of them independently. For instance, a span exporter may be left +unconfigured, although the trace context propagation was configured to enrich logs or metrics. + +Platforms such as ASP.NET may pre-configure out-of-the-box +propagators. If pre-configured, `Propagator`s SHOULD default to a composite +`Propagator` containing the W3C Trace Context Propagator and the Baggage +`Propagator` specified in [api-baggage.md](../baggage/api.md#serialization). +These platforms MUST also allow pre-configured propagators to be disabled or overridden. ### Get Global Propagator