# Observability endpoints (Admin API)

> 5 FeatherPanel Admin API endpoints from admin/observability.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/admin/observability/

Defined in [`backend/app/routes/admin/observability.php`](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/routes/admin/observability.php). Authentication used here: **Admin**. Read [Authentication](https://featherpanel.com/docs/api/authentication/) for how to send credentials and [Rate limits and errors](https://featherpanel.com/docs/api/rate-limits-and-errors/) for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

## Endpoints

### GET `/api/admin/observability`

- Auth: Admin
- Permission: `admin.settings.view`
- Route name: `admin-observability-show`
- Controller: [`ObservabilityController::show`](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/Controllers/Admin/ObservabilityController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/routes/admin/observability.php#L26)

**Observability settings and status** Metrics, logging and Loki settings (secrets are never returned) plus queue and endpoint status.

```bash
curl -X GET "$PANEL_URL/api/admin/observability" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Settings and status

### PATCH `/api/admin/observability`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-observability-update`
- Controller: [`ObservabilityController::update`](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/Controllers/Admin/ObservabilityController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/routes/admin/observability.php#L36)

**Update observability settings**

```bash
curl -X PATCH "$PANEL_URL/api/admin/observability" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Saved · `422` Invalid value

### POST `/api/admin/observability/metrics-token`

- Auth: Admin
- Permission: `admin.settings.edit`
- Default rate limit: 10 / minute (`admin-observability`)
- Route name: `admin-observability-token-rotate`
- Controller: [`ObservabilityController::rotateToken`](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/Controllers/Admin/ObservabilityController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/routes/admin/observability.php#L47)

**Generate or rotate the metrics token** Creates a new bearer token for /api/system/metrics and invalidates the previous one. The token is only returned in this response.

```bash
curl -X POST "$PANEL_URL/api/admin/observability/metrics-token" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` New token (shown once)

### DELETE `/api/admin/observability/metrics-token`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-observability-token-revoke`
- Controller: [`ObservabilityController::revokeToken`](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/Controllers/Admin/ObservabilityController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/routes/admin/observability.php#L60)

**Revoke the metrics token**

```bash
curl -X DELETE "$PANEL_URL/api/admin/observability/metrics-token" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Revoked

### POST `/api/admin/observability/loki-test`

- Auth: Admin
- Permission: `admin.settings.edit`
- Default rate limit: 10 / minute (`admin-observability`)
- Route name: `admin-observability-loki-test`
- Controller: [`ObservabilityController::testLoki`](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/Controllers/Admin/ObservabilityController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/b7d8353f30f822c6aeae3b7be72604deedc5aa92/backend/app/routes/admin/observability.php#L71)

**Send a test line to Loki** Pushes one log line synchronously. Unsaved url, username, password, tenant and labels in the body override the saved values for this test only.

```bash
curl -X POST "$PANEL_URL/api/admin/observability/loki-test" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Result of the push
