Keywords AI is now Respan! Learn more
Return the active span ID as a hex string.
get_current_span_id() -> Optional[str]
None
from respan_tracing import RespanTelemetry, get_client, task telemetry = RespanTelemetry(api_key="your-api-key") @task(name="span_demo") def span_demo(): client = get_client() span_id = client.get_current_span_id() print(f"Span ID: {span_id}") # e.g. "00f067aa0ba902b7" return span_id span_demo()
Was this page helpful?