Monitor coding agent activity
Monitor coding-agent adoption, token usage, and session spend with Unity Gateway. Query usage records for custom analysis, use the built-in dashboard to compare agents and investigate sessions, or inspect traces for detailed agent activity.
Check usage in ug CLI
Check your personal and shared Unity Gateway spend limits from your terminal:
ug usage
Example output:
Your Unity Gateway spend limits
[█████████████████████████░░░░░] 85% used
Monthly personal limit (budget 8f3c2a91)
$85.00 of $100.00 used · $15.00 remaining this month
[██████████████████░░░░░░░░░░░░] 60% used
Monthly shared limit (budget 4d7b9e02)
[███████░░░░░░░░░░░░░░░░░░░░░░░] 25% used
Daily personal limit (budget 8f3c2a91)
$5.00 of $20.00 used · $15.00 remaining today
The output shows up to five applicable limits and the percentage used for each, ordered from highest to lowest percentage used. Run ug usage --all to see all applicable limits.
For more information, see the ug CLI reference.
Usage tracking
Unity Gateway records model and MCP requests in system.ai_gateway.usage, including the requesting user, workspace, service, and status. Model requests also include model, token usage, and latency information.
The table also includes the following session metadata for coding-agent activity:
- Session and subagent IDs: Connect requests to a coding session and its subagents.
- Coding agent and agent version: Identify the agent and its reported version.
- Surface: A space-delimited list of surfaces representing the full client stack.
- Reasoning effort and smart router name: Describe the request’s reasoning configuration and reported routing recipe.
For access requirements and the complete schema, see Track model usage. For session fields, see Session metadata.
Usage dashboard
Open Unity Gateway > Govern > Usage Dashboard, then select Coding Agents.
Use this tab to:
- Track adoption: Compare active users and sessions across coding agents.
- Understand workflows: See which agent harnesses developers use and which coding agents they pair them with.
- Compare usage: Examine average daily sessions per user, tokens per session, and subagents per session.
- Explore model usage: See which models are used in coding-agent sessions. A session can use more than one model.
- Investigate session spend: Review Top 1000 Sessions by Est. Spend to identify high-spend sessions and examine their users, models, services, token usage, and subagents.
Use the Coding Agents selector to focus on specific agents. Session metrics reflect activity within the selected dates. Session duration includes idle time between recorded calls; it does not measure active coding time.

If a dashboard has not been created, an account admin can create it from Govern > Create Usage Dashboard. See Built-in usage dashboard.
Tracing
The unified trace table is in Beta. An account admin must enable the Enhanced Unity Gateway preview from the account console Previews page. See Manage Databricks previews.
The unified trace table stores gateway request traces and client-side agent traces in the same Unity Catalog table:
- Gateway traces capture model and MCP requests handled by Unity Gateway. Collection starts when you enable unified tracing.
- Client-side traces capture activity emitted by the coding agent on the developer's machine. Enable them through the Unity Gateway CLI to add agent execution details to the same table.
Set up unified tracing
With the Enhanced Unity Gateway preview enabled, a metastore admin creates the trace table once for workspaces attached to the metastore:
- Open Unity Gateway > Govern > Traces and click Set up tracing.
- Select the catalog and schema for the trace table.
- Click Save.
Traces are stored at the Unity Catalog location selected during setup: <catalog>.<schema>.<table>. Open Govern > Traces to inspect them, or query the table in Databricks SQL. The table owner must grant access before other users can query it.

For access controls and query examples, see Monitor all AI activity using the unified trace table. For columns and span attributes, see the Unified trace table schema reference.
During Beta, the unified trace table has some limitations. See Limitations.
Enable client-side tracing
The Unity Gateway CLI configures Claude Code and Codex to send their traces to the unified trace table you set up above.
In your coding agent configuration, add the following setting inside each supported agent's existing config object, then publish the update:
{
"tracing": {
"enabled": true
}
}
Developers launch the agent through ug claude or ug codex. The CLI applies the tracing setting and configures the export endpoint and authentication. To apply an update immediately, see Sync configuration updates.
To send client-side traces from your own applications to the unified trace table, see Send client-side traces from your application.