IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

get_current_trace_id

def get_current_trace_id[level: TraceLevel]() -> Int

Returns the id of last created trace entry on the current thread.

Parameters:

  • level (TraceLevel): The trace level to check.

Returns:

Int: The ID of the current trace if profiling is enabled, otherwise 0.