> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getfoil.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics

> Monitor AI performance with Foil analytics

# Analytics

Foil provides comprehensive analytics to understand your AI application's performance, costs, and quality.

## Dashboard Overview

The main dashboard shows key metrics at a glance:

| Metric             | Description                          |
| ------------------ | ------------------------------------ |
| **Total Requests** | Number of traces in the time period  |
| **Success Rate**   | Percentage of successful completions |
| **Avg Latency**    | Mean response time                   |
| **Active Agents**  | Agents with recent activity          |
| **Alert Count**    | Active alerts requiring attention    |

## Available Analytics

The dashboard includes charts and breakdowns for:

* **Requests over time** — volume trends with agent breakdown
* **Success/failure rates** — error trends and patterns
* **Latency distribution** — response time buckets and p50/p95/p99 percentiles
* **Token usage** — input/output token consumption over time
* **Cost breakdown** — costs by model and time period
* **Error analytics** — errors by type and error rate trends
* **Tool usage** — which tools are used by which agents

All analytics support filtering by date range, agent, and time granularity (hourly, daily, weekly, monthly).

These metrics are also available via the [REST API](/api-reference/introduction).

## Best Practices

<AccordionGroup>
  <Accordion title="Monitor success rate trends">
    A dropping success rate often indicates issues before they become critical.
  </Accordion>

  <Accordion title="Track p95 latency">
    Average latency can hide outliers. p95 shows what your slowest users experience.
  </Accordion>

  <Accordion title="Set up cost alerts">
    Monitor costs closely, especially when testing new prompts or models.
  </Accordion>

  <Accordion title="Compare week-over-week">
    Regular comparisons help identify regressions quickly.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Alerting" icon="bell" href="/features/alerting">
    Set up alerts
  </Card>

  <Card title="Experiments" icon="flask" href="/features/experiments">
    Run A/B tests
  </Card>
</CardGroup>
