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

# Set Up Metrics and Monitoring

> Configure health endpoints and metrics collection for gateway monitoring.

Configure health endpoints and metrics collection to monitor your Golf Gateway deployment and set up alerting.

## Prerequisites

* Golf Gateway deployed and running
* Monitoring system

## Health endpoints

Golf Gateway exposes two health endpoints:

### `/health` - Liveness probe

Returns component health status:

```bash theme={null}
curl http://localhost:8080/health
```

Response:

```json theme={null}
{
  "status": "healthy",
  "redis": "ok",
  "redis_circuit_breaker": "closed",
  "database": "ok",
  "upstreams": "3 configured",
  "http_client": "ok",
  "gateway_id": "abc-123",
  "gateway_name": "production-gateway"
}
```

| Status Code | Meaning                          |
| ----------- | -------------------------------- |
| 200         | All components healthy           |
| 503         | One or more components unhealthy |

### `/readiness` - Readiness probe

Returns whether gateway is ready to accept traffic:

```bash theme={null}
curl http://localhost:8080/readiness
```

Response:

```json theme={null}
{
  "status": "ready",
  "draining": false,
  "http_client": "initialized",
  "upstreams": "3 loaded",
  "redis_manager": "initialized"
}
```

| Status Code | Meaning                 |
| ----------- | ----------------------- |
| 200         | Ready to accept traffic |
| 503         | Not ready or draining   |

## Kubernetes probes

Configure probes in your deployment:

```yaml theme={null}
apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      containers:
      - name: golf-gateway
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 10
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: /readiness
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 5
          failureThreshold: 2
```

## Health status levels

| Status      | Meaning                          |
| ----------- | -------------------------------- |
| `HEALTHY`   | All systems operational          |
| `DEGRADED`  | Partial issues, still functional |
| `UNHEALTHY` | Critical issues, exports blocked |

## Related guides

* [Export Logs to OpenTelemetry](/gateway/guides/audit-trail/export-to-opentelemetry) - OTLP metrics
* [Export Logs to Elasticsearch](/gateway/guides/audit-trail/export-to-elasticsearch) - Log analytics
