respan-instrumentation-temporal
Respan instrumentation for Temporal Python 1.30–1.x. It adapts Temporal's official OpenTelemetry interceptor, preserving its context propagation, sandbox execution, completed-span extern hook and history replay behavior.
Install
pip install respan-ai respan-instrumentation-temporal
The package requires respan-tracing>=2.17 and respan-sdk>=2.6.26; earlier SDK wheels do not publish the constants this adapter imports.
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 inherited by workers.
client = await Client.connect("localhost:7233")
# Stop workers before flushing and shutting down telemetry.
respan.flush()
respan.shutdown()
For Temporal's ephemeral test server or custom client factories, pass the same interceptor explicitly:
from temporalio.testing import WorkflowEnvironment
environment = await WorkflowEnvironment.start_time_skipping(
interceptors=[instrumentor.interceptor]
)
An existing native TracingInterceptor is respected, avoiding duplicate tracing. Multiple active instances must use matching options; the final owner restores only its own Client.connect wrapper. Existing clients retain their interceptor after deactivation.
Captured data
Workflow/activity starts record the arguments and identifiers exposed by the native input. Activity execution and workflow completion record their actual results; client queries record their actual responses. Standard JSON containers, dataclasses, supported Pydantic models, protobuf messages and binary values are preserved. Temporal headers are excluded. Capture uses complete payloads by default; max_attribute_chars explicitly opts into a JSON preview size limit.
Spans use canonical workflow/task input and output fields. The adapter records sanitized OpenTelemetry error status and error.message; it does not invent HTTP status codes, usage or successful result placeholders. Native values, exceptions and cancellation outcomes pass through unchanged when telemetry fails.
TemporalInstrumentor(capture_content=False)
Content capture also honors TRACELOOP_TRACE_CONTENT=false and Respan's ENABLE_CONTENT_TRACING_KEY context veto. Ambient and supplied contexts are combined, denied ancestor decisions persist after completion, and later vetoes scrub owned content before the span ends. Unobserved recording parents fail closed. Sampling and instrumentation suppression are checked before payload access. Exception events are omitted to keep raw tracebacks from bypassing content controls.
Temporal's native workflow spans are instantaneous and replay-aware. A cancellation while waiting can finish the workflow without emitting a native CompleteWorkflow span. Worker-side query/signal spans describe native operation boundaries; query results are available on the client span. This adapter retains those boundaries.
Validation
pytest tests -m 'not integration'
pytest tests -m integration
Integration tests run bare and instrumented SDK workflows on the actual local time-skipping server, checking complete payloads, failures, signals, queries, cancellation and history replay. Temporal downloads its test-server binary on first use; TEMPORAL_TEST_SERVER_PATH can select an existing compatible binary.
Metadata
Release files for respan-instrumentation-temporal 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| respan_instrumentation_temporal-0.2.0.tar.gz | 15.1 kB | With provenance | Details for respan_instrumentation_temporal-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| respan_instrumentation_temporal-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for respan_instrumentation_temporal-0.2.0-py3-none-any.whl |
Total release size: 30.9 kB
Release files / respan_instrumentation_temporal-0.2.0.tar.gz
| Download URL | respan_instrumentation_temporal-0.2.0.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4a8919e100b937e0bf32b6c2f2eccaaa9f09a4d9087d1eb35d25e8ea56cb55f
|
|
BLAKE2b-256 checksum How to use checksums |
a2686359442e4b5ad78601baf2eba5176f893b750a0800d691e5bb1aa58d6f34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / respan_instrumentation_temporal-0.2.0-py3-none-any.whl
| Download URL | respan_instrumentation_temporal-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ceb1b9edd20b7338fdcf0ec8c1343c1296e409e91e4155a3ca4654c4adeb622e
|
|
BLAKE2b-256 checksum How to use checksums |
69d6a2ba236b77200b57e746ac8e7eedc1b0293b2e2dd2a93b7cbf46accc466d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logSecurity for respan-instrumentation-temporal 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for respan_instrumentation_temporal-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.