Observability¶
Snowflake AI Observability provides monitoring and tracing capabilities for CoCo in Snowsight sessions. You can use it to review prompt history, trace agent execution, and attribute credit consumption to individual prompts or sessions.
What’s tracked¶
Every CoCo interaction emits span-level records into the SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS event table. Each user prompt is one turn, which corresponds to one OpenTelemetry trace (trace_id). That trace is made up of spans, including:
CodingAgentRun: Top-level span for the turn. One record per turn.CodingAgent.Step-0: The primary model-call span for the turn. Contains the user prompt, model response, token counts, tool selection, latency, and arequest_id.
Additional spans can capture planning, tool execution, SQL, chart generation, response generation, inputs and outputs, and user feedback. For the same terms applied to Cortex Agents, see Terminology.
Accessing observability data¶
For Cortex Agents, External Agents, and Cortex Search services, use GET_AI_OBSERVABILITY_EVENTS with the matching agent_type. That is the recommended path: results are scoped to the object and enforce privileges on it. See AI_OBSERVABILITY_EVENTS table.
CoCo in Snowsight does not use a separate object type in that function. To query CoCo spans, filter SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS by RECORD:name (for example CodingAgent.Step-0). That direct-table path is typical for CoCo and usually requires AI_OBSERVABILITY_READER or another admin role, as described in the LOCAL schema reference.
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 for a single turn, group on TRACE['trace_id']:
Access control¶
CoCo span queries use direct SELECT on AI_OBSERVABILITY_EVENTS because there is no CoCo-specific agent_type for the observability table functions. Grant SNOWFLAKE.AI_OBSERVABILITY_READER only when this role needs that direct-table access (for example operators running the examples above). For retention deletes, grant SNOWFLAKE.AI_OBSERVABILITY_ADMIN. For the recommended access model for agents, search services, and External Agents, see AI_OBSERVABILITY_EVENTS table.
To join observability data with CORTEX_CODE_SNOWSIGHT_USAGE_HISTORY, the role also needs read access to the SNOWFLAKE database:
More information¶
For the AI Observability overview and links to every Cortex feature, see AI Observability with Snowflake Cortex. For TruLens datasets, metrics, and runs, see Snowflake AI Observability Reference. For the shared event table and GET_AI_* functions, see LOCAL schema.