Skip to main content

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

respan_instrumentation_temporal-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

File details

Details for the file respan_instrumentation_temporal-0.1.0.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_temporal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 89071f96b5f1f1812b013ca478d26142efe856062ff2ee4af9f595ce5323dd37
MD5 c406eb70045b54a310a009753d480f00
BLAKE2b-256 60d4d94be12dfd12daaad0f9d24cfb33a78e066a0a461f5d01e7cb16a9c884e6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page