Skip to main content
Snowflake Cortex hero Openlayer integrates with Snowflake Cortex Agents to help you monitor, evaluate, and improve the agents running inside your Snowflake account. The integration authenticates with key-pair auth, automatically discovers your agents, and periodically pulls their execution traces from SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS so you can inspect every turn in Openlayer.

How it works

Once connected, Openlayer:
  1. Discovers your agents — enumerates Cortex Agents account-wide with SHOW AGENTS, then reads each one’s specification for its tools and sample questions
  2. Creates projects and data sources — each enabled agent gets its own Openlayer project and data source, with no manual setup required
  3. Syncs traces — polls the AI observability event table on a schedule, assembling spans into complete traces before they are written
  4. Enriches traces — extracts model names, token counts (including cache reads and writes), tool calls, SQL statements, and the Snowflake user and role behind each request
All access is read-only — Openlayer never writes to your Snowflake account, and never runs your agents.
Because Cortex Agents are a fully managed service, there is no process you control in which to configure an OpenTelemetry exporter. Openlayer therefore reads the observability event table directly, which is the approach Snowflake documents for third-party tools.

Prerequisites

Before connecting, you need:
  • A Snowflake account with at least one Cortex Agent.
  • Permission to create users and roles (SECURITYADMIN), and to grant an account-level privilege (ACCOUNTADMIN).
  • A running warehouse Openlayer can use.
  • An Openlayer workspace where you are an admin.

Setup guide

Step 1: Open the integration

In Openlayer, go to Settings → Integrations. This page lists every integration available to your workspace. The Openlayer integrations page Find Snowflake Cortex and click Enable.

Step 2: Copy your workspace’s public key

The connect page shows your workspace’s RSA public key, along with the four connection fields. The Snowflake Cortex connect page, showing the workspace RSA public key Copy the key — you will paste it into the script in the next step. Openlayer generates and holds the matching private key, so no password or secret is ever entered into Snowflake or into Openlayer.

Step 3: Create the role and service user

Run the following in a Snowflake worksheet. Replace the RSA_PUBLIC_KEY value with the key you just copied, and set agent_database and agent_schema to the database and schema that contain your agents.
If your agents live in more than one schema, re-run the last four grants for each one, changing agent_database and agent_schema each time.
READ UNREDACTED AI OBSERVABILITY EVENTS TABLE is not optional. Snowflake redacts observability content by default. Without this account-level privilege, Openlayer receives only metadata — tool names, token counts, latency, model name — with no prompts, responses, or tool inputs and outputs. Most of the evaluation catalog (groundedness, hallucination, answer relevancy, PII, prompt injection) needs the content to work at all. Openlayer checks this at setup and reports the result rather than degrading silently.
Granting MONITOR on future agents means agents created later are picked up by discovery without another grant. Without it, you must re-run the grant and re-run discovery each time an agent is added.

Step 4: Connect from Openlayer

Back on the connect page, fill in: Click Connect. Openlayer validates the credentials against Snowflake before saving anything — if the account, user, role, or warehouse is wrong, the connection fails immediately rather than silently failing on the first sync.

Step 5: Discover and enable agents

Click Discover to enumerate the agents your role can see. Each discovered agent appears in the Objects table. Click Enable on an agent to start monitoring it. Openlayer creates a project and data source for it, runs the redaction check, and begins syncing. Once connected, the page shows the connection’s status, the agents it found, and whether content is readable: The Snowflake Cortex integration page once connected
SHOW AGENTS returns only objects your role holds a privilege on, with no error when the list is incomplete. If an agent you expect is missing, check the MONITOR grants for its schema. Openlayer surfaces a warning when the inventory may be partial.

What gets synced

Openlayer maps each Cortex trace onto its own trace format: Each trace also carries the Snowflake user, session, and role that ran it, so you can filter and group by who invoked the agent and under what privilege. A Snowflake Cortex trace in Openlayer

Token accounting

Cortex reports prompt tokens inclusive of cache reads and writes. Openlayer breaks them into a non-overlapping set — input_tokens, cached_tokens, cache_creation_tokens, output_tokens — so cost estimates do not double-count cached input. Multi-turn agents frequently see high cache-hit rates, so any figure that ignores this is materially wrong.

Settings

Backfilling history

To re-read a window that has already been polled — or one older than your initial sync range — open the menu on an agent row and choose Backfill. Backfill runs independently of the ongoing sync: it drains its own window while normal polling continues forward, so recent traces keep arriving while history fills in behind them. Duplicate records are filtered automatically, so re-running a backfill is safe.
Backfill drains in windows rather than in one query, so a large range takes several sync cycles to complete. Progress is shown on the agent’s row.

Troubleshooting

No agents appear after clicking Discover. Your role likely lacks MONITOR on the schema containing them. SHOW AGENTS silently omits objects the role cannot see. Re-run the grant monitor on all agents in schema ... statement for each relevant schema. Traces sync but contain no prompts or responses. The READ UNREDACTED AI OBSERVABILITY EVENTS TABLE privilege is missing. Openlayer shows content visibility on the integration page — if it reads redacted, grant the privilege as ACCOUNTADMIN and re-sync. The connection status shows an error after a sync. Openlayer distinguishes credential failures, which stop the whole connection, from per-agent failures, which skip that agent and continue. The error message on the integration page names the most recent failure. A dropped or renamed agent in Snowflake is skipped rather than treated as a credential problem; the next discovery marks it as removed. An agent shows zero synced traces. Confirm the agent has activity inside your configured sync range. Cortex writes traces only when an agent actually runs, and the initial range defaults to the last 7 days — use Backfill to reach further back.