ArzuleRun provides fine-grained control over trace collection. Use it when you need to:
- Write traces to a specific destination
- Access the run ID during execution
- Control run boundaries explicitly
Basic usage
Constructor parameters
Properties
| Property | Type | Description |
|---|---|---|
run_id | str | UUID identifying this run |
tenant_id | str | Tenant identifier |
project_id | str | Project identifier |
started_at | datetime | When the run began |
event_count | int | Number of events captured |
Methods
emit(event: TraceEvent)
Manually emit a trace event:
flush()
Force-flush any buffered events:
Custom run IDs
Provide your own run ID for correlation with external systems:Run metadata
Attach custom metadata to runs:Nested runs
Runs cannot be nested. Starting a newArzuleRun while one is active will raise an error:
Error handling
If an exception occurs inside the run, it’s recorded and re-raised:error with the exception details captured.
Async support
For async code, useasync with:
