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

# Prometheus API Overview

> Prometheus-compatible API for Grafana and monitoring tools

The Aris Brain exposes a Prometheus-compatible API at `/prometheus/*` for integration with Grafana and other monitoring tools.

## Why Prometheus Format?

The Prometheus query API is a de facto standard for time-series monitoring. By exposing this interface, Aris Brain can integrate with:

* **Grafana** - Create dashboards and alerts
* **Prometheus** - Federate metrics
* **AlertManager** - Configure alerting rules
* **Custom tools** - Any Prometheus-compatible client

## Base URL

```
http://aris.local/prometheus/api/v1/
```

## Authentication

<Warning>
  The Prometheus endpoints require **API token** authentication (not session tokens).

  Create an API token via the web UI or `/api/tokens` endpoint.
</Warning>

Include the token in the `Authorization` header:

```bash theme={null}
curl http://aris.local/prometheus/api/v1/query?query=up \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

## Grafana Configuration

When adding as a Prometheus data source in Grafana:

| Setting            | Value                                  |
| ------------------ | -------------------------------------- |
| **URL**            | `http://aris.local/prometheus`         |
| **Access**         | Server (default)                       |
| **Custom Headers** | `Authorization: Bearer YOUR_API_TOKEN` |

## Available Endpoints

| Endpoint                      | Method    | Description              |
| ----------------------------- | --------- | ------------------------ |
| `/api/v1/query`               | GET, POST | Instant query            |
| `/api/v1/query_range`         | GET, POST | Range query              |
| `/api/v1/labels`              | GET       | List all label names     |
| `/api/v1/label/{name}/values` | GET       | List values for a label  |
| `/api/v1/series`              | GET       | Find series by selectors |
| `/api/v1/metadata`            | GET       | Metric metadata          |

## Backend

The Prometheus API proxies to VictoriaMetrics running on the Brain. VictoriaMetrics provides efficient storage and querying of time-series data with full PromQL support.
