# Configuration
URL: /api/configuration

Health, metrics, and query analytics — operational endpoints, not collection settings.



Server configuration itself (listen address, data directory, auth keys, and
so on) is set entirely through CLI flags and environment variables, not the
API — see [Docs → Configuration](/docs/configuration). The endpoints below
are what the running server exposes about its own operation.

## Health [#health]

```
GET /health
```

Always public, no API key required. Used by the Docker image's
`HEALTHCHECK` (via `tachyon --healthcheck`) and suitable for a load balancer
health check.

```bash
curl localhost:8108/health
```

## Metrics [#metrics]

<Callout type="info">
  Requires the admin or search key.
</Callout>

```
GET /metrics
```

Returns metrics in Prometheus text exposition format, suitable for scraping
directly.

```bash
curl localhost:8108/metrics
```

## Analytics [#analytics]

<Callout type="info">
  Requires the admin or search key. Analytics are held in
  memory and reset when the server restarts — they are not persisted to disk.
</Callout>

```
GET /analytics/top
GET /analytics/zero-results
GET /analytics/latency
```

`/analytics/top` and `/analytics/zero-results` share query parameters and
response shape:

| Parameter    | Type   | Default         | Description                     |
| ------------ | ------ | --------------- | ------------------------------- |
| `collection` | string | all collections | Restrict to one collection      |
| `limit`      | int    | `20`            | Max queries returned, max `500` |

```json
{
  "queries": [
    {
      "query": "wireless mouse",
      "collection": "products",
      "count": 42,
      "zero_result_count": 0,
      "last_result_count": 1,
      "avg_latency_ms": 0.8,
      "last_seen": 1750000000000
    }
  ],
  "tracked_queries": 128,
  "dropped_queries": 0
}
```

`/analytics/latency` returns aggregate query latency:

```json
{
  "count": 5000,
  "mean_ms": 1.2,
  "p50_ms": 0.9,
  "p95_ms": 3.6,
  "p99_ms": 4.5,
  "max_ms": 12.1,
  "total_searches": 5000,
  "uptime_seconds": 3600,
  "queries_per_second": 1.39
}
```
