Skip to main content

Respan instrumentation for Apache Burr

This package attaches a Burr lifecycle adapter when ApplicationBuilder.build() is called. It maps Burr's own execution model:

  • application execution methods (run, arun, iterate, streaming methods) become workflow spans
  • state-machine actions become task spans with their declared reads, writes, tags, inputs, sequence ID, result, and state transition
  • Burr custom ActionSpan instances become nested task spans
  • Burr stream lifecycle callbacks become span events
  • attributes logged through Burr's tracing API are retained in Respan metadata

Burr application IDs are mapped to Respan trace-group identifiers and Burr partition keys are mapped to thread identifiers.

Activate Respan before building the application:

from burr.core import ApplicationBuilder, Result, State, action, default, expr
from respan import Respan
from respan_instrumentation_burr import BurrInstrumentor

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

@action(reads=["count"], writes=["count"])
def increment(state: State) -> State:
    return state.update(count=state["count"] + 1)

result = Result("count").with_name("result")

app = (
    ApplicationBuilder()
    .with_identifiers(app_id="counter-app", partition_key="user-42")
    .with_actions(increment, result)
    .with_transitions(("increment", "increment", expr("count < 2")))
    .with_transitions(("increment", "result", default))
    .with_entrypoint("increment")
    .with_state(count=0)
    .build()
)

try:
    _, _, state = app.run(halt_after=["result"])
    print(state["count"])
finally:
    respan.shutdown()

Set capture_content=False to retain Burr operation identity and status while omitting state, action inputs/results, stream items, and logged attribute values.

Metadata

Release files for respan-instrumentation-burr 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-burr 0.1.1
File Size Uploaded
respan_instrumentation_burr-0.1.1.tar.gz 6.2 kB Details

Built distribution (wheel)

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

Total release size: 14.4 kB

Release files / respan_instrumentation_burr-0.1.1.tar.gz

Download URL respan_instrumentation_burr-0.1.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f9631ea0a986deaf2aebb4a23dc20c2dd4d2d5678cead522cc6be4d11f8830c0
BLAKE2b-256 checksum
How to use checksums
0b68ca8bf9b1a8d97a33c59ae0455dae5d585cab83b72ff7ddd0d4d639e1c74e
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_burr-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_burr-0.1.1-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38fd6c3ac0b590e5cece7cbbc68c913ea2d6e110d541ebe31196b9194267a6e9
BLAKE2b-256 checksum
How to use checksums
e23066b2823d64fe7704f83e01f6f65b2faf7844633822d006a1118f01b709f2
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