Skip to main content

Analyze agent usage with Insights

Beta

Insights is in Beta. Insights reads the unified trace table, which requires the Enhanced Unity Gateway beta features. An account admin turns them on from the account console Previews page. See Manage Databricks previews.

Insights reports show what people in your organization use agents for, such as Claude Code and Codex, and where their tokens go. To build a report, Genie Code reads a sample of sessions from your unified trace table and groups them into workstreams, the kinds of work people use agents for.

Every report answers two questions:

  • What are agents working on? The Workstreams chart groups sessions by the kind of work they do. It also compares each workstream's share of sessions with its share of tokens, so you can see which workstreams use the most tokens. A workstream with 10% of sessions and 35% of tokens is the first place to look.
  • Where can I save money? The report ranks the places tokens go to waste by the tokens at stake: sessions with very large context, tasks that a smaller model could handle, MCP tool results and definitions that fill context, and failing MCP calls. It also lists reusable workflows, the multi-step workflows people repeat by hand across sessions, each with a suggested skill prompt you can copy to turn it into a shared skill.

You can also add up to 10 questions of your own. Usage is measured in tokens, not dollars. To track dollar spend, see Analyze Unity Gateway cost.

Requirements​

  • The unified trace table set up for your metastore. The report runs with your permissions, so you need USE CATALOG on the table's catalog, USE SCHEMA on the table's schema, and SELECT on the table. See Permissions and access control.
  • Agents launched with the Unity Gateway CLI so their sessions land in the trace table. See ug CLI reference.
  • CAN USE permission on a SQL warehouse. CAN USE lets you start the warehouse and run queries on it. Insights runs its queries on the warehouse you select when you generate a report. See SQL warehouse ACLs.

Generate a report​

  1. In the workspace sidebar, click AI Gateway.
  2. In the page header, click Observability. Insights opens first. To return to it from Traces, click Insights in the side navigation.
  3. Optionally, type your own questions under Ask your own question, pressing Enter after each one. For example, ask whether Claude Code or Codex uses fewer tokens for the same kind of work.
  4. Choose the time window to analyze: Last day, Last 7 days, or Last 30 days.
  5. Select a SQL warehouse.
  6. Click Generate report.

The new report opens and shows that it is being generated. A report usually takes 15 to 20 minutes to generate. To return to your list of reports while the report generates, click Back to reports. You can generate more than one report at a time.

Read a report​

Each report starts with key figures for tokens and sessions, then a headline for each built-in question. Findings link to the traces behind them, so you can open the sessions that support each one. Answers to your own questions follow the built-in sections.

The Sample section at the end lists the traces and sessions analyzed, the time window, the agent clients covered, and the trace table read. Sessions without enough evidence to classify are counted as not classified and left out of the Workstreams chart.

Each card in a report has a question box. Type a follow-up question about that card, and Genie Code answers it in a conversation for that card. The savings cards are Bloated context, Model right-sizing, Wasted MCP spend, and Failing MCP calls. To keep asking about the whole report, open the Genie Code conversation that wrote the report.

Access to reports​

Reports summarize other users' prompts and activity. Only the user who generated a report can view or delete it.

Additional resources​