---
title: "Analytics & Observability"
id: "587"
type: "page"
slug: "analytics-observability"
published_at: "2026-06-03T14:29:23+00:00"
modified_at: "2026-09-21T01:36:28+00:00"
url: "https://xedant.com/agents/agent/docs/validation/analytics-observability"
markdown_url: "https://xedant.com/agents/agent/docs/validation/analytics-observability.md"
excerpt: "Message-level checks answer whether the reply is correct, builds catch errors in the code, and…"
---

# Analytics & Observability

[https://xedant.com/agents/agent/docs/validation/analytics-observability.md](https://xedant.com/agents/agent/docs/validation/analytics-observability.md)

Message-level checks answer whether the reply is correct, builds catch errors in the code, and analytics looks at the work as a whole: are you using AI efficiently, how much does it cost, and where can you save? It gathers data on token spend (tokens are the portions of text you pay for), cost, response speed, and activity across all your sessions, and shows the patterns clearly — for example, at which hours of the day you work most productively.

![Xedant Agent analytics page with charts](https://xedant.com/wp-content/uploads/2026/06/analytics-page-v3.png)## Per-Message Data

Every message in a chat has its own numbers. Hover over a message to see its stats; running totals are shown in the page header:

- **Processing time** — how many seconds the model spent on that answer
- **Input tokens** — how much text was sent to the model at this step
- **Output tokens** — how much text the model generated in reply
- **Cache read tokens** — text taken from the cache (a repeat request for data that was already processed): this is faster and noticeably cheaper than fresh input
- **Cost** — the calculated price of the answer at the model’s rates (including input, output, and cache)

These numbers make it easy to catch problems on the fly. An unusually large input combined with a high share of cache tokens means the cache is not being used efficiently — in that case, it is worth trying a different [backend](/agents/agent/docs/backends)
. Long processing time with a huge output is a sign that the model is generating text it does not need.

## Analytics Dashboard

The analytics page assembles a dashboard of 24 charts grouped into collapsible sections — you can open only what you need.

### Overview cards

At the top of the page are the key numbers for the selected period: the count of projects, sessions, your messages, model replies, and tools used, plus total cost, all token types, processing time, and the number of commits. The cards update on their own when you change the period.

### Usage charts

- **Cost breakdown** — a pie chart showing where the money goes
- **Tokens over time** — how input, output, and cache token usage changed day by day
- **Messages over time** — the total number of messages for the selected period
- **Tokens per second** — the model’s response speed; handy for comparing models against each other
- **Cost by hour** — when during the day you spend the most
- **Prompts by hour** — how many prompts you send at each hour
- **Commits by hour** — when you usually save the results of your work

### Pattern analysis

- **Tokens by hour of day** — when your usage peaks
- **Messages by hour of day** — when you are most active
- **Tokens by day of week** — your weekly usage rhythm
- **Messages by day of week** — which days are the most productive

### Distributions

- **Tokens distribution** — how token usage is spread across sessions
- **Messages distribution** — how much sessions differ in size
- **Cost distribution** — which chats consume the most
- **Duration distribution** — how widely processing times vary

### Model comparison

- **Cost by model** — how much each model or provider spends
- **Tokens by model** — how much text each model burns through
- **Speed by model** — compare how fast models answer and pick the one with the best price-to-quality ratio

## Period and Detail Level

All charts follow the period selection at the top of the dashboard:

- **Preset periods** — today, last 7 days, last 30 days, last 90 days
- **Custom period** — any start and end dates

The detail level controls how finely the data is split:

- **Hourly** — one data point per hour; good for short periods (today, yesterday)
- **Daily** — one data point per day; this is the default
- **Weekly** — weekly totals; fits periods from a month to a quarter
- **Monthly** — monthly totals; for long-term observations

If the selected period is longer than 31 days, the dashboard automatically switches hourly detail to daily so the charts stay readable.

## Chat Table

Below the charts is a sortable table of all sessions in the selected period. Each row shows the chat title, model, total cost, token counts, processing time, the number of your messages, and the number of replies and commits. Click a column header to sort by it; long lists are split into pages.

The table shows both regular chats and sub-agent chats (from [automated prompt builds](/agents/agent/docs/validation/prompt-builds)
) — they are linked to the main conversation. This lets you trace the whole chain: from your message to the checking agent it launched.

## Export to ClickHouse

If you run several projects, it is convenient to see statistics for all of them at once. For that, Xedant Agent can send analytics data to ClickHouse — a database built for large volumes of data. Each session produces a detailed set of metrics: tokens (input, output, cache), cost, processing time, message and commit counts — for the main chat and for sub-agent chats alike.

- **Storage** — data is split by month and, within each month, ordered by project, time, and chat, so it stays fast to search even at large volumes
- **Delivery** — data is sent in batches of 500 records; on failure the send retries automatically
- **Setup** — just set the database address in the `AGENT_CLICKHOUSE_URL` environment variable. A “Push to ClickHouse” button then appears on the analytics page for manual export

With the data in ClickHouse you can build your own reports and charts — for example, dashboards in Grafana (a tool for visualizing data) covering all your projects at once instead of one at a time.

## Practical Tips

- **Watch the cache** — a high share of cache read tokens means the context is being reused efficiently and you are saving money. A low share means every step processes a lot of new text
- **Compare model costs** — the cost-by-model chart shows whether a cheaper model handles your routine tasks. If quality does not suffer, switch
- **Watch for fix loops** — a sharp cost rise after enabling [AutoFix](/agents/agent/docs/autofix) can mean the model is stuck in a loop. Look in the chat table for sessions with an unusually high message count
- **Check response speed** — tokens per second differs noticeably between models. If a model is consistently slow, it makes sense to pick a faster one for those tasks
- **Plan work around your peaks** — the commits-by-hour chart tells you when you produce your best results. Schedule important tasks for your most productive hours

For more on what analytics can do, see the [Analytics](/agents/agent/docs/analytics)
 section. For monitoring each message during a session, see [Chat Output Validation](/agents/agent/docs/validation/chat-output)
. For managing context, see [Context Utilization](/agents/agent/docs/context-utilization)
.

**[← Model Control with Hooks](/agents/agent/docs/validation/hooks-control)**

**[File Viewer & Script Runner →](/agents/agent/docs/validation/file-script)**
