Python SDKTracing Clientget_current_trace_id()Copy pageSignature 1get_current_trace_id() -> Optional[str] Returns the current trace ID as a 32-character hex string, or None when no span is active. Example 1from respan import Respan, get_client, workflow23respan = Respan(api_key="your-api-key")45@workflow(name="trace_demo")6def trace_demo():7 client = get_client()8 trace_id = client.get_current_trace_id()9 print(f"Trace ID: {trace_id}") # e.g. "0af7651916cd43dd8448eb211c80319c"10 return trace_id1112trace_demo()