How to use the opentelemetry-api.src.opentelemetry.context.thread_local_context.ThreadLocalRuntimeContext function in opentelemetry-api

To help you get started, we’ve selected a few opentelemetry-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github open-telemetry / opentelemetry-python / opentelemetry-api / src / opentelemetry / context / __init__.py View on Github external
if __name__ == '__main__':
        asyncio.run(main())
"""

from .base_context import BaseRuntimeContext

__all__ = ["Context"]

try:
    from .async_context import AsyncRuntimeContext

    Context = AsyncRuntimeContext()  # type: BaseRuntimeContext
except ImportError:
    from .thread_local_context import ThreadLocalRuntimeContext

    Context = ThreadLocalRuntimeContext()

opentelemetry-api

OpenTelemetry Python API

Apache-2.0
Latest version published 4 days ago

Package Health Score

97 / 100
Full package analysis