Skip to main content

Functions

get_current_trace()

Returns the currently active Trace object, or None if called outside a trace context.

get_current_trace_id()

Shorthand for get_current_trace().id. Returns the active trace ID string, or None.

Use Cases

Both functions are useful for correlating RDK traces with your application logs, metrics, or external systems.

Examples

Log correlation

Attach trace ID to response headers

Read trace fields

Outside a trace

See Also