Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Admin API

Meridian runs an optional admin HTTP server on a separate port for operational visibility.

Configuration

admin_address = "127.0.0.1:9901"

Endpoints

GET /stats

Returns metrics in Prometheus text exposition format:

$ curl http://localhost:9901/stats

# HELP meridian_downstream_cx_total Total downstream connections accepted
# TYPE meridian_downstream_cx_total counter
meridian_downstream_cx_total 15423

# HELP meridian_downstream_cx_active Active downstream connections
# TYPE meridian_downstream_cx_active gauge
meridian_downstream_cx_active 42

# HELP meridian_circuit_breaker_rejected Circuit breaker rejections
# TYPE meridian_circuit_breaker_rejected counter
meridian_circuit_breaker_rejected 0

# HELP meridian_server_live Server liveness (1=live)
# TYPE meridian_server_live gauge
meridian_server_live 1

GET /clusters

Returns cluster state as JSON, including endpoint health and active request counts:

$ curl http://localhost:9901/clusters

{
  "clusters": [
    {
      "name": "api-backend",
      "endpoints": [
        {"address": "10.0.1.1:8080", "healthy": true, "active_requests": 5},
        {"address": "10.0.1.2:8080", "healthy": true, "active_requests": 3},
        {"address": "10.0.1.3:8080", "healthy": false, "active_requests": 0}
      ]
    }
  ]
}

GET /config

Returns a summary of the current configuration:

$ curl http://localhost:9901/config

{"listeners": 2, "clusters": 3, "routes": 5}

GET /ready

Liveness probe for container orchestrators:

$ curl http://localhost:9901/ready

LIVE

Other Paths

Unknown paths return 404 with a list of available endpoints.

Prometheus Integration

Point your Prometheus scrape config at the /stats endpoint:

scrape_configs:
  - job_name: 'meridian'
    static_configs:
      - targets: ['meridian-host:9901']
    metrics_path: '/stats'
    scrape_interval: 15s