Skip to main content

Signature

is_recording() -> bool
Returns True if there is an active span that is recording, False otherwise.

Example

from respan_tracing import RespanTelemetry, task, get_client

telemetry = RespanTelemetry(api_key="your-api-key")

@task(name="guarded_task")
def guarded_task():
    client = get_client()
    if client.is_recording():
        client.add_event("task_running")
    return "done"

guarded_task()