# See sessions, runs, tokens and latency on the AgentOS homepage

> Agno AgentOS serves daily metrics for sessions, runs, tokens, users, models and latency from /os/metrics routes, built in the background from stored runs.

- Published: 2026-11-12
- Author: Harsh Sinha
- Categories: Changelog
- Canonical: https://www.agno.com/blog/see-sessions-runs-tokens-and-latency-on-the-agentos-homepage
- Markdown: https://www.agno.com/blog/see-sessions-runs-tokens-and-latency-on-the-agentos-homepage.md

Agno AgentOS now gives your homepage daily metrics through six routes under `/os/metrics/*`: sessions, runs, tokens, users, models and latency. Each route covers the last 30 days unless you pass `starting_date` and `ending_date`. The sessions, runs and tokens views list every day in the window and compare its total with the window of the same length before it.

AgentOS builds these numbers from the sessions and runs you already store, and it keeps them in three new tables:

- `agno_component_metrics` keeps a row per day, user and agent, team or workflow.
- `agno_aggregate_metrics` keeps daily and monthly totals per user and for everyone.
- `agno_metrics_refreshes` holds the lock that lets one process refresh at a time.

A background task refreshes every database at startup and then every `metrics_calculation_interval_seconds`, recalculating only the days whose runs changed. The routes only read, so a page load never triggers a calculation. Every database class Agno ships gets the same tables and builder, from SQLite and Postgres to MongoDB, DynamoDB and the in-memory store.

```python
from agno.os import AgentOS
from agno.os.settings import AgnoAPISettings

agent_os = AgentOS(
    db=db,
    agents=[support],
    settings=AgnoAPISettings(metrics_calculation_interval_seconds=300),
)
```

One request reads every database the AgentOS serves and sums them. `db_ids` names the databases that answered and `skipped_db_ids` the ones that failed or ran past `timeout_seconds`, and a repeatable `db_id` parameter narrows the read. When the databases live on a remote AgentOS, the gateway forwards the whole view there in one request. Each answer carries an `ETag`, so a dashboard that sends it back in `If-None-Match` gets `304 Not Modified` until the rows behind it change.

We seeded four stored runs across two SQLite databases with `upsert_session` and `upsert_run` (no model call), triggered `POST /os/metrics/refresh`, and read the routes with FastAPI's `TestClient`:

```text
GET /os/metrics/runs     {"total_runs": 4, "status_metrics": {"COMPLETED": 3, "ERROR": 1}, "success_rate": 75.0, "db_ids": {"support-db": ..., "research-db": ...}}
GET /os/metrics/sessions with If-None-Match: <its ETag>     304, empty body
```

After one more stored session and a second refresh, the same conditional request returned 200 with a new ETag and four sessions.

![Real output from the AgentOS metrics routes over seven days and two SQLite databases: 3 sessions, 4 runs at 75% success, 1,010 tokens, median duration 2,250 ms with p95 3,850 ms, median time to first token 550 ms, gpt-5 on 75% of runs and claude-sonnet-4-5 on 25%, and a 304 Not Modified answer for a repeat request with If-None-Match](https://www.agno.com/images/v3-2-0-os-metrics-homepage.png)

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/13_observability/os_metrics.py), and learn more about [AgentOS](https://docs.agno.com/agent-os/overview) in the documentation.
