Skip to main content

Overview

The /metrics endpoint returns real-time load balancer metrics in JSON format for easy integration with monitoring systems and custom dashboards. Endpoint: GET /metrics Response Format: application/json Authentication: None (configure firewall rules to restrict access)

Request

Response Format

Fields Reference

Global Metrics

total_requests
integer
Total number of requests processed since startup
successful_requests
integer
Number of successful requests (2xx, 3xx status codes)
failed_requests
integer
Number of failed requests (4xx, 5xx, timeouts)
avg_response_time_ms
float
Average response time in milliseconds
min_response_time_ms
float
Minimum response time observed
max_response_time_ms
float
Maximum response time observed
p50_response_time_ms
float
50th percentile (median) response time
p95_response_time_ms
float
95th percentile response time
p99_response_time_ms
float
99th percentile response time
uptime_seconds
integer
Load balancer uptime in seconds
requests_per_second
float
Current requests per second rate
algorithm
string
Active load balancing algorithm

Backend Metrics

backends[].address
string
Backend server address (host:port)
backends[].healthy
boolean
Health status (true = healthy, false = unhealthy)
backends[].active_connections
integer
Current number of active connections to this backend
backends[].total_requests
integer
Total requests sent to this backend
backends[].failures
integer
Current failure count (resets on successful health check)
backends[].avg_response_time_ms
float
Average response time for this backend
backends[].circuit_state
string
Circuit breaker state: closed, open, or half_open

Usage Examples

Python

JavaScript/Node.js

Go

Bash/cURL

Integration Examples

Custom Dashboard

Alerting Script

Prometheus Endpoint

Prometheus metrics format

Monitoring Setup

Complete monitoring guide

Metrics Concept

Understanding metrics

Health Checks

Health check system