-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Feature RequestNew feature or requestNew feature or requestenhancementNew feature or requestNew feature or request
Description
Description
Add comprehensive health check endpoints for monitoring and load balancing.
Endpoints to Add
- /health - Basic health check (existing, enhance)
- /health/ready - Readiness probe
- /health/live - Liveness probe
Health Checks
Each endpoint should check:
- API connectivity to Opik
- Authentication status
- Resource availability
- Transport status
Implementation
app.get('/health', (req, res) => {
res.json({ status: 'ok', timestamp: Date.now() });
});
app.get('/health/ready', async (req, res) => {
const checks = {
api: await checkApiConnectivity(),
auth: await checkAuthentication(),
transport: checkTransportStatus()
};
const ready = Object.values(checks).every(c => c.status === 'ok');
res.status(ready ? 200 : 503).json({
ready,
checks,
timestamp: Date.now()
});
});
app.get('/health/live', (req, res) => {
res.json({ alive: true, uptime: process.uptime() });
});
Tasks
- Enhance existing /health endpoint
- Add /health/ready endpoint
- Add /health/live endpoint
- Implement API connectivity check
- Implement authentication check
- Add detailed status information
- Add tests
- Document endpoints
Use Cases
- Kubernetes liveness/readiness probes
- Load balancer health checks
- Monitoring systems
- Debugging connectivity issues
Metadata
Metadata
Assignees
Labels
Feature RequestNew feature or requestNew feature or requestenhancementNew feature or requestNew feature or request