respan-instrumentation-temporal
Respan instrumentation for the Temporal Python SDK. It adapts Temporal's official replay-aware OpenTelemetry interceptor instead of patching workflow execution directly, preserving Temporal context propagation and replay semantics while emitting canonical Respan workflow and task fields.
The instrumentor injects its interceptor into Client.connect() automatically. The same interceptor is exposed as instrumentor.interceptor for Temporal test environments and custom client factories that accept an explicit interceptors list.
Install
pip install respan-ai respan-instrumentation-temporal temporalio
Usage
from temporalio.client import Client
from respan import Respan
from respan_instrumentation_temporal import TemporalInstrumentor
instrumentor = TemporalInstrumentor()
respan = Respan(instrumentations=[instrumentor])
# The interceptor is appended automatically and is inherited by workers
# created from this client.
client = await Client.connect("localhost:7233")
For WorkflowEnvironment:
from temporalio.testing import WorkflowEnvironment
environment = await WorkflowEnvironment.start_time_skipping(
interceptors=[instrumentor.interceptor]
)
If an explicit Temporal TracingInterceptor is already present, Respan does not append a second tracing interceptor, avoiding duplicate spans.
Content capture
TemporalInstrumentor(capture_content=False)
Content capture includes workflow/activity arguments and Temporal identifiers when the relevant interceptor input exposes them. With capture disabled, spans retain stable operation and workflow/activity type information but omit arguments and IDs. Temporal headers are never captured. Errors record OpenTelemetry error status plus backend-visible status_code and error.message fields. activate() and deactivate() are idempotent.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file respan_instrumentation_temporal-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_temporal-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.3.2 CPython/3.13.12 Linux/6.17.0-35-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89071f96b5f1f1812b013ca478d26142efe856062ff2ee4af9f595ce5323dd37
|
|
| MD5 |
c406eb70045b54a310a009753d480f00
|
|
| BLAKE2b-256 |
60d4d94be12dfd12daaad0f9d24cfb33a78e066a0a461f5d01e7cb16a9c884e6
|