Health Check
Monitor the health and status of the ConstellationAPI.
GET /health
Check if the API is running and healthy.
Request
GET /health
No authentication required.
Response
200 OK
{
"status": "healthy",
"timestamp": "2024-01-01T00:00:00.000Z",
"version": "1.0.0",
"environment": "production"
}
Response Fields
| Field | Type | Description |
|---|---|---|
status | string | Health status (healthy or unhealthy) |
timestamp | string | Current server timestamp (ISO 8601) |
version | string | API version |
environment | string | Environment (production, development, test) |
Example
curl http://localhost:3007/health
Use Cases
- Monitoring: Use in health checks for load balancers and monitoring systems
- Status Pages: Display API status on status pages
- CI/CD: Verify API is running before running integration tests
GET /metrics
Get Prometheus metrics for monitoring and observability.
Request
GET /metrics
No authentication required.
Response
200 OK
Prometheus-formatted metrics:
# HELP http_request_duration_seconds Request duration in seconds
# TYPE http_request_duration_seconds histogram
http_request_duration_seconds_bucket{le="0.005",method="GET",route="/health",status="200"} 10
http_request_duration_seconds_bucket{le="0.01",method="GET",route="/health",status="200"} 20
...
# HELP http_requests_total Total number of HTTP requests
# TYPE http_requests_total counter
http_requests_total{method="GET",route="/health",status="200"} 100
...
Example
curl http://localhost:3007/metrics
Use Cases
- Monitoring: Scrape metrics with Prometheus
- Alerting: Set up alerts based on metrics
- Dashboards: Visualize metrics in Grafana