Skip to main content

Respan instrumentation for Restate

This package instruments the Restate Python SDK through its invocation_context_managers extension point. It adds one span around each handler invocation attempt registered on a:

  • restate.Service
  • restate.VirtualObject
  • restate.Workflow

The span records Restate-specific service, handler, invocation, replay, object/workflow key, scope, limit-key, and idempotency-key context. Request content is deserialized with the handler's configured Restate serde. Restate does not expose the serialized handler result to invocation context managers, so the adapter records completion status without inventing a response body.

Activate Respan before registering handlers:

import restate
from respan import Respan
from respan_instrumentation_restate import RestateInstrumentor

respan = Respan(
    api_key="...",
    instrumentations=[RestateInstrumentor()],
)

greeter = restate.Service("Greeter")


@greeter.handler()
async def greet(ctx: restate.Context, name: str) -> str:
    return f"Hello, {name}!"

Restate invocation IDs are mapped to Respan trace-group identifiers. Object and workflow keys are mapped to thread identifiers so repeated invocations can be correlated. Set capture_content=False to omit the deserialized request.

Metadata

Release files for respan-instrumentation-restate 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-instrumentation-restate 0.1.1
File Size Uploaded
respan_instrumentation_restate-0.1.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-restate 0.1.1
File Interpreter ABI Platform
respan_instrumentation_restate-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.5 kB

Release files / respan_instrumentation_restate-0.1.1.tar.gz

Download URL respan_instrumentation_restate-0.1.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1346169fb0bc98250cc741b2e30d58bcd5efaa5589144fa373158dad47ea4976
BLAKE2b-256 checksum
How to use checksums
598d73bb903fcc1ad076353d58858f779a5946345cd19d213a65426abc0853eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / respan_instrumentation_restate-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_restate-0.1.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c93e7376f4a58bd4f7714f268a63a477471c9306b3b932c4ef3db443544b05b7
BLAKE2b-256 checksum
How to use checksums
485dfac99f7901789d6e2e38bf63b84af754a9d613e4fe1709a9e217b0671289
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page