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
ActionSpaninstances 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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_burr-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_burr-0.1.0.tar.gz
- Upload date:
- Size: 5.5 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 |
5bf2b84346ca19d114c969dc27b81a7cd3ce6ea764dc9fae0faed0e7a91ec280
|
|
| MD5 |
23c2fb6c5c54a603bcae2f6b7b5572b0
|
|
| BLAKE2b-256 |
728725ed936a63e92e8e11d47a3eab55f2172cf8a12b4f76a15ba1eaad0f348f
|
File details
Details for the file respan_instrumentation_burr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_burr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- 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 |
7122d75f73f790e7329ef03e9d1ca5cf2396027be93dad4f6001672ee04f6f9f
|
|
| MD5 |
0501dccfe785575479feb02565d23e16
|
|
| BLAKE2b-256 |
98fb2cdb1262a9e80ccaa21c9c4317e2670f3e4fe658ec84064848bde7446714
|