OpenStack oslo.service instrumentation for OpenTelemetry
Project description
OpenTelemetry oslo.service Instrumentation
OpenStack oslo.service instrumentation for OpenTelemetry.
oslo.service is OpenStack's service framework: it launches services and runs
their background work (ThreadGroup, looping/periodic calls, RPC servers) on
either a threading or an eventlet backend. This instrumentor emits no
telemetry of its own — it makes the active trace context survive the
concurrency boundaries oslo.service introduces, so spans and oslo.log records
created in spawned work stay correlated with the request that spawned them.
The trace a record/span is correlated to comes from the current OpenTelemetry
context, which lives in a contextvars.Context. Python does not copy that
context into new threads or greenthreads, so work handed to a worker would
otherwise start on a fresh, disconnected trace (or export trace_id/span_id
as 0).
On instrument() it:
- selects the oslo.service backend (threading by default) unless the host has
already chosen one — set
OTEL_PYTHON_OSLO_SERVICE_BACKEND=threading|eventletor passbackend="..."; - propagates the active context across oslo.service's concurrency primitives.
What gets propagated
| Backend | Primitive | Wrapped |
|---|---|---|
| threading | ThreadGroup.add_thread (a threading.Thread per task) |
threading.Thread.start / run |
| threading | looping / periodic calls (a futurist pool) |
futurist.ThreadPoolExecutor.submit |
| eventlet | greenthreads (ThreadGroup, hand-offs) |
eventlet.spawn / spawn_n / spawn_after, GreenPool.spawn / spawn_n, futurist.GreenThreadPoolExecutor.submit |
Not covered:
- stdlib
concurrent.futuresthread pools — enableopentelemetry-instrumentation-threading; threading.Timer/Threadsubclasses that overriderun, and cross-process (ProcessPoolExecutor) work.
Note: this context propagation previously lived in the oslo.messaging (eventlet spawns) and oslo.log (threads/futurist) instrumentors. It is consolidated here so it is defined once and benefits every OpenStack service, regardless of which of those instrumentors it also enables.
Usage
from opentelemetry.instrumentation.oslo_service import OsloServiceInstrumentor
OsloServiceInstrumentor().instrument()
To pair with log/trace instrumentation, enable it alongside the others (order does not matter):
OsloServiceInstrumentor().instrument()
OsloMessagingInstrumentor().instrument(tracer_provider=tracer_provider)
OsloLogInstrumentor().instrument(logger_provider=logger_provider)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opentelemetry_instrumentation_oslo_service-0.11.0.tar.gz.
File metadata
- Download URL: opentelemetry_instrumentation_oslo_service-0.11.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27f743c4028bdbe3c7741fc4db3303247aea03d3fc4d204c4105f8bfc62ae770
|
|
| MD5 |
0b20bc42bc186fe08504c7f3686d9878
|
|
| BLAKE2b-256 |
b677b301b560bcae0f2b2248e33166fbcf1495436b1feaed128603a8a460b0cd
|
Provenance
The following attestation bundles were made for opentelemetry_instrumentation_oslo_service-0.11.0.tar.gz:
Publisher:
publish-pypi.yml on daipham3213/opentelemetry-openstack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opentelemetry_instrumentation_oslo_service-0.11.0.tar.gz -
Subject digest:
27f743c4028bdbe3c7741fc4db3303247aea03d3fc4d204c4105f8bfc62ae770 - Sigstore transparency entry: 2084244978
- Sigstore integration time:
-
Permalink:
daipham3213/opentelemetry-openstack@841cbbc246d8f3694a445b31958b4aecf11d5933 -
Branch / Tag:
refs/tags/0.11.0 - Owner: https://github.com/daipham3213
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@841cbbc246d8f3694a445b31958b4aecf11d5933 -
Trigger Event:
release
-
Statement type:
File details
Details for the file opentelemetry_instrumentation_oslo_service-0.11.0-py3-none-any.whl.
File metadata
- Download URL: opentelemetry_instrumentation_oslo_service-0.11.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a159df039f5109c3c7eed5ebaee0201a2403ef81bd40fa4eccf9edfc42e12d86
|
|
| MD5 |
089070e67a14e937d6fee0e2d72a93e0
|
|
| BLAKE2b-256 |
c6aa72da95c5c6f7837e00d2551de8e5221f7a9a63b65fe5d1e8200260c6c97a
|
Provenance
The following attestation bundles were made for opentelemetry_instrumentation_oslo_service-0.11.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on daipham3213/opentelemetry-openstack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opentelemetry_instrumentation_oslo_service-0.11.0-py3-none-any.whl -
Subject digest:
a159df039f5109c3c7eed5ebaee0201a2403ef81bd40fa4eccf9edfc42e12d86 - Sigstore transparency entry: 2084244990
- Sigstore integration time:
-
Permalink:
daipham3213/opentelemetry-openstack@841cbbc246d8f3694a445b31958b4aecf11d5933 -
Branch / Tag:
refs/tags/0.11.0 - Owner: https://github.com/daipham3213
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@841cbbc246d8f3694a445b31958b4aecf11d5933 -
Trigger Event:
release
-
Statement type: