Overview
The/health endpoint provides a simple health check to verify that the Permission Mongo server is running and responsive. This endpoint is useful for basic uptime monitoring and load balancer health checks.
Endpoint
Authentication
No authentication required. This endpoint is publicly accessible.Request
No request parameters or body required.Example Request
Response
Success Response (200 OK)
Returns a JSON object indicating the server is healthy.Response Fields
| Field | Type | Description |
|---|---|---|
data.status | string | Health status. Always returns "ok" when the server is running |
data.goroutines | integer | Number of active goroutines in the server process |
meta.request_id | string | Unique identifier for the request |
Implementation Details
The health check endpoint:- Updates the
permission_mongo_server_goroutinesPrometheus metric before responding - Does not check external dependencies (MongoDB, Redis)
- Always returns 200 OK if the server is running
- Bypassed by authentication middleware for fast response times
Source Code Reference
Implementation:~/workspace/source/pkg/api/server.go:409
Use Cases
- Load Balancer Health Checks: Configure your load balancer to poll this endpoint
- Uptime Monitoring: Use monitoring tools to verify service availability
- Kubernetes Liveness Probes: Simple check to restart unhealthy pods
- CI/CD Pipeline Validation: Verify deployment success
Related Endpoints
- GET /ready - Readiness check with dependency validation
- GET /metrics - Prometheus metrics endpoint