Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving active span interaction To Trace Context Utilities (#923)
* Moving active span interaction To TracerProvider Fixes #455. The previous spec stated that the active span get / set behavior MUST behave the same across Tracers retrieved from the same TracerProvider. As such, the active span manipulation methods are better provided by the TracerProvider directly. As it is still cumbersome to retrieve the current TracerProvider simply to get the current span, add in the concept of a "Trace Package", that can provide utilty methods to delegate to the configured default TracerProvider. This enables a fluid interface to retrieve the current span: from opentelemetry import trace current_span = trace.get_current_span() To help maintain backwards compatibility, the Tracer may still expose active span methods. * Adding missing entries for TracerProvider functionality * Addressing feedback * fixing lint (multiple blank lines) * Addressing feedback Removing the get / set current span methods from the TracerProvider. There is consensus that the functions should have the same behavior regardless of the TracerProvider. This change now means that the span retrieval methods can not be defined completely by the Trace Package. Moving the requirements up to the package level. * Addressing comments Selecting "Tracing Context Utilities" rather than "Trace Package" to provide clear guidance on languages that do not have static module-level functions. Adding a section on the ability to expose these as module-level functions to ensure that the simplified workflow of a top-level get / set span is possible. * fixing invalid Trace Package reference * removing unrelated change * adding changelog entry Co-authored-by: Carlos Alberto Cortez <calberto.cortez@gmail.com> Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
- Loading branch information