Trace analytics for Cortex AI Gateway

Trace analytics charts the gateway’s trace table in Snowsight: which models your users call, how often requests fail, which MCP tools agents call, and how long conversations run. Each chart is computed from AGENT_TRACE_TABLE for the time range you choose.

To open it, sign in to Snowsight, select AI Gateway > Observability, and then select the Analytics tab. It has four views: Models, Reliability, Tools, and Sessions.

Before you begin

  • Set logging.enabled to true in the gateway specification. See Gateway specification.
  • Select a warehouse in the page header. The charts run their queries on it.
  • Use a role with one of these privileges on the gateway:
PrivilegeWhat the charts cover
MONITOR or OWNERSHIPEvery user’s traces.
USAGEOnly your own traces.

What the charts count

The charts count two kinds of span:

  • Model requests: spans with gen_ai.operation.name set to chat.
  • Tool calls: MCP tool calls, spans with gen_ai.operation.name set to execute_tool.

Spans that clients send to the gateway over OTLP aren’t included. See Send client traces to the gateway.

Input tokens include cache reads, and output tokens include reasoning tokens.

Note

Trace analytics is provided for informational purposes to help you monitor and troubleshoot gateway usage. Metrics are approximate, may be incomplete or delayed, and aren’t intended to be used as a measure of service performance or availability.

Models

The Models view covers model requests: which models are called, by how many users, and with how many tokens.

The summary cards show Requests, successful and failed; Input tokens, including cache reads; Output tokens; and Active users, the distinct users who sent a model request.

Chart or tableWhat it shows
Requests per modelRequests per hour or day, stacked by the model that served them.
Users per modelDistinct users per hour or day, stacked by model.
Input tokens per model, Output tokens per modelTokens per hour or day, stacked by model.
Input tokens per request, Output tokens per request, Tokens per requestP50, P90, and P99 per request over time. Tokens per request is input plus output.
Cache read tokens per requestP50, P90, and P99 of cached input tokens per request, for providers that report cache use.
Requests per user, Tokens per userP50, P90, and P99 across users of each user’s requests or tokens per hour or day.
Most used modelsModels ranked by requests, with tokens, share of requests, and distinct users.

Tools

The Tools view covers MCP tool calls through the gateway, by server and tool. A turn is one model request plus the tool calls that follow it. Tool latency and failure rates are on the Reliability view.

The summary cards show Tool calls; MCP servers called; the median Tool calls per turn, counting turns with no tool call as zero; and Turns with a tool call, the percentage of turns that made at least one.

Chart or tableWhat it shows
Tool calls per MCP server, Tool calls per toolTool calls per hour or day, stacked by server or tool.
Tool calls per turnA histogram of turns by number of tool calls, and P50, P90, and P99 over time.
Repeated tool callsPercentage of tool calls that repeat an earlier call with the same arguments in the same turn. Only calls that report their arguments are counted.
Most used toolsTools ranked by calls, with MCP server, share of calls, and distinct users.

Reliability

The Reliability view covers latency, failures, and prompt cache use for model requests and tool calls.

The summary cards cover model requests. They show Latency, the median time from when the gateway receives a successful request to its last token; Cache hit rate, the percentage of input tokens read from the prompt cache, for providers that report cache use; Failure rate, the percentage of requests with an outcome other than Success or Cancelled; and Rate limited, the percentage rejected with HTTP 429.

Chart or tableWhat it shows
End-to-end latencyP50, P90, and P99 latency of successful model requests over time.
Cache hit rateP50, P90, and P99 across requests of each request’s cache hit rate.
Rate limits by modelHTTP 429 rejections per hour or day, stacked by model.
Rate limit ratePercentage of requests rejected with HTTP 429, over time.
Model request failure rateP50, P90, and P99 across users of each user’s failure rate.
Tool request failure rateP50, P90, and P99 across tools of each tool’s failure rate.
Tool failure rate by MCP server, Tool failure rate by toolPercentage of tool calls that failed, for each server or tool, over time.
Unsuccessful requestsModel requests that didn’t succeed, per hour or day, stacked by outcome.
Outcome breakdownPercentage of model requests with each outcome. Unknown requests are counted in a note below the chart.
Highest model failure ratesModel and error pairs with the most failures, such as 503 Service unavailable, with count, failure rate, and trend.
Highest tool failure ratesTools ranked by failure rate, with MCP server, calls, failed calls, and P50 and P95 latency.

Sessions

The Sessions view covers conversations: how long they run and how responses end. A session is the set of requests that share a gen_ai.conversation.id. Requests without one aren’t in any session. See How traces are structured.

The summary cards show the median Turns per session, Tool calls per session, Tokens per session, and Session duration, measured from a session’s first request to its last, including idle time.

Chart or tableWhat it shows
Turns per session, Tool calls per session, Tokens per session, Session durationP50, P90, and P99 by the day the session started.
Stop reasonsWhy responses ended, by model: natural end, tool call, token limit, content filter, other, or not reported.
Long sessionsSessions above the 95th percentile for turns or tool calls, with conversation ID, agent, client, user, turns, tool calls, tokens, duration, and percentile.

When you filter the Sessions view by model, only sessions whose model requests all used the selected models are shown. With two models selected, that’s sessions that used only the first, only the second, or both.

Request outcomes

Each model request and tool call gets an outcome from its HTTP status code:

OutcomeMeaning
SuccessThe request completed without an error.
ThrottledRejected with HTTP 429 because a rate limit was reached.
Policy deniedRejected with HTTP 401 or 403, for example because the caller lacked access or a quota blocked the user.
CancelledThe client cancelled the request before it completed (HTTP 499).
Invalid requestRejected with any other 4xx status, such as a malformed request or an unknown model.
Server failureThe gateway or model provider returned an HTTP 5xx status.
UnknownNo status code was recorded.

Failure rates and rate-limit rates exclude Unknown requests.

Cost considerations

Each view queries the trace table on the warehouse you selected, which consumes warehouse credits. Longer time ranges and busier gateways scan more data. For the cost of storing traces, see Cost considerations.