Observability¶
Snowflake AI Observability provides monitoring and tracing capabilities for Cortex Code in Snowsight sessions. You can use it to review prompt history, trace agent execution, attribute credit consumption to individual prompts or sessions.
What’s tracked¶
Every Cortex Code interaction emits span-level records into the SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS event table. Each interaction produces two span types:
CodingAgentRun: The session-level envelope. One record per conversation turn.CodingAgent.Step-0: An individual model call. Contains the user prompt, model response, token counts, tool selection, latency, and arequest_id.
The spans capture conversation history, agent execution steps (LLM planning, tool execution, SQL execution, chart generation, and response generation), the inputs and outputs for each step, and user feedback.
Accessing observability data=¶
- SQL. Query the
SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTSevent table directly. Filter for Cortex Code spans byRECORD:name.
Example: List recent prompts¶
Cost attribution¶
To attribute credit consumption to individual prompts, join the event table to CORTEX_CODE_SNOWSIGHT_USAGE_HISTORY on REQUEST_ID:
To attribute cost across a full conversation, group on TRACE['trace_id']:
Access control¶
To read observability data, grant the AI_OBSERVABILITY_READER application role:
To manage event retention (DELETE or TRUNCATE), grant SNOWFLAKE.AI_OBSERVABILITY_ADMIN instead.
To join observability data with CORTEX_CODE_SNOWSIGHT_USAGE_HISTORY, the role also needs read access to the SNOWFLAKE database:
More information¶
For the full AI Observability reference, including evaluation metrics, tracing, and comparison features, see Snowflake AI Observability Reference.