---
title: "Prometheus metrics"
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/logbrook/llms.txt
> Use this file to discover all available pages before exploring further.

# Prometheus metrics

Path: Logbrook API › Server

`GET /metrics`

Requires a read token with no source or index restriction. Scoped tokens get `403`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/metrics' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = '<base-url>/metrics';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/metrics"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Prometheus text format

#### Example

```text
# HELP logbrook_ingested_events_total Durably committed events
# TYPE logbrook_ingested_events_total counter
logbrook_ingested_events_total 10
# HELP logbrook_ingest_rejected_total Rejected ingest requests
# TYPE logbrook_ingest_rejected_total counter
logbrook_ingest_rejected_total 3
# HELP logbrook_ready Storage readiness
# TYPE logbrook_ready gauge
logbrook_ready 1
# HELP logbrook_http_duration_seconds Handler latency by endpoint
# TYPE logbrook_http_duration_seconds histogram
logbrook_http_duration_seconds_bucket{endpoint="/health",le="0.001"} 1
logbrook_http_duration_seconds_bucket{endpoint="/health",le="0.01"} 1
logbrook_http_duration_seconds_bucket{endpoint="/health",le="0.1"} 1
logbrook_http_duration_seconds_bucket{endpoint="/health",le="0.5"} 1
logbrook_http_duration_seconds_bucket{endpoint="/health",le="1"} 1
logbrook_http_duration_seconds_bucket{endpoint="/health",le="5"} 1
logbrook_http_duration_seconds_bucket{endpoint="/health",le="+Inf"} 1
logbrook_http_duration_seconds_sum{endpoint="/health"} 0.000037
logbrook_http_duration_seconds_count{endpoint="/health"} 1

```

### 401

Invalid read credential

### 403

Global metrics require an unrestricted read credential

### 429

HTTP or metrics diagnostics capacity exhausted; Retry-After: 1


Source: https://sandrinodm.github.io/logbrook/api/metrics/index.md
