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

# Analytics

> Turn a filtered set of request logs or traces into usage, performance, cost, and quality charts.

Analytics turns the current [Search](https://docs.promptlayer.com/features/search-and-analytics/search.md) query into charts. Use it to move from an individual [request log](https://docs.promptlayer.com/features/observability/request-logs.md) or [trace](https://docs.promptlayer.com/features/observability/traces.md) to trends in usage, performance, cost, errors, and application behavior.

![Analytics Page Screenshot](https://mintcdn.com/promptlayer/4xCQDros0B-lHSut/images/analytics-page.png?fit=max\&auto=format\&n=4xCQDros0B-lHSut\&q=85\&s=d54be502853801914cbc867dd8e0b751)

## Open Analytics

1. Open [**Request Logs**](https://docs.promptlayer.com/features/observability/request-logs.md) or [**Traces**](https://docs.promptlayer.com/features/observability/traces.md) in the PromptLayer sidebar.
2. Set the date range and add any free-text or structured filters.
3. Switch from the Requests or Traces tab to **Analytics**.
4. Select **Run query** after changing the analytics query.

The table and Analytics tab use the same query. You can narrow the data first and then chart only the matching request logs or traces.

## Request Analytics

Request analytics includes views for:

* Latency, request volume, tokens, and cost over time
* Requests by model, prompt, and status
* Response format, cached tokens, and reasoning tokens
* Provider, prompt, tag, and metadata cost breakdowns
* Common errors, metadata keys, output keys, and tools

Use metadata and tags to compare environments, customers, application versions, or other segments that matter to your application.

## Trace Analytics

Trace analytics includes views for:

* End-to-end latency, including average, p50, p90, and p95
* Trace volume and status over time
* Models and tools used across traces
* Prompt templates and workflows used across traces
* Trace- and span-level filters

## Interact with Charts

Many charts can update the current query. Depending on the chart, select a point, bar, or segment to add a filter, or drag across a time-series chart to narrow the date range. Use **Undo** to restore the previous analytics query.

## Ask for an Analysis

Open the PromptLayer assistant and ask a question such as, "Create a graph of the most used prompts over the past week." It can inspect request or trace analytics and create a chart from the relevant data.

![PromptLayer assistant showing request-data insights](https://mintcdn.com/promptlayer/h7WHmpLSXFiZ0xvF/images/wrangler_insights.png?fit=max\&auto=format\&n=h7WHmpLSXFiZ0xvF\&q=85\&s=40e3e0344fab4e2e8f82c357c3582167)

> [!NOTE]
>
> Analytics is unavailable when the selected search range includes data from before your workspace's OpenSearch cutover date. See [Search Older Data](https://docs.promptlayer.com/features/search-and-analytics/search.md#search-older-data).

## Use Analytics through the API

* [Request Analytics](https://docs.promptlayer.com/reference/request-analytics.md)
* [Request Analytics - Custom Queries](https://docs.promptlayer.com/reference/request-analytics-custom-analytics.md)
* [Trace Analytics - Custom Queries](https://docs.promptlayer.com/reference/trace-analytics-custom-analytics.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.