Documentation ยท Telemetry

Let AgentLedger read Cortex Code traces

Cortex Code already records every session in Snowflake's own telemetry. One grant lets AgentLedger read it, so cost and traces appear without changing how developers work.

Grant trace access

Run as ACCOUNTADMIN:

GRANT APPLICATION ROLE SNOWFLAKE.AI_OBSERVABILITY_READER TO APPLICATION AGENTLEDGER;

Cortex Code sessions appear on the next refresh. Open the dashboard from the app's page in Snowsight. Its Setup view shows which steps are complete.

What the app reads

AgentLedger is built on Snowflake's own telemetry, not on a proxy or a sidecar. It reads:

  • SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS โ€” Cortex Code runs and their steps: model calls, tool calls, SQL, timings and status.
  • SNOWFLAKE.ACCOUNT_USAGE.SNOWFLAKE_COCO_USAGE_HISTORY โ€” billed AI credits per request, when Snowflake has metered them.
  • SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY and QUERY_ATTRIBUTION_HISTORY โ€” the SQL an agent ran, tagged with the request that caused it.

Each request is matched to the session that produced it using the Cortex Code session id, which is the same in the traces and in the developer hook. That is what makes cost per developer, branch and pull request possible.

No sessions yet?

Snowflake delivers traces on a best-effort basis and ACCOUNT_USAGE views can lag by a few hours, so recent activity can take a while to appear. The app refreshes every hour. If nothing appears at all, check that the grant above succeeded and that Cortex Code is enabled for the account.

Next steps