Introduction
HAProxy is a high-performance, open-source load balancer and reverse proxy for TCP and HTTP applications. Monitoring HAProxy is essential for tracking key performance metrics such as request rates, response times, error rates, active sessions, and backend health.
To monitor HAProxy efficiently, we can use the OpenTelemetry HAProxy Receiver, which collects key HAProxy performance metrics and makes them available for analysis.
Kubernetes 2.0 ConfigMap
Users should update or append the existing ConfigMap named opsramp-workload-metric-user-config
by adding application-specific fields. These fields may include authentication credentials, collection frequency, and other relevant configurations.
To run OpenTelemetry Redis Receiver with Kubernetes, you need to create a ConfigMap and deploy it.
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-config
namespace: default
data:
haproxy.cfg: |
global
log stdout format raw local0
stats socket /var/run/haproxy.sock mode 660 level admin
maxconn 4000
defaults
mode http
log global
option httplog
timeout connect 5s
timeout client 50s
timeout server 50s
frontend http_front
bind *:8080 # Changed from 80 to 8080
default_backend http_back
backend http_back
balance roundrobin
server server1 127.0.0.1:8080 check
listen stats
bind *:8081 # Changed from 8404 to 8081
stats enable
stats uri /stats
stats refresh 10s
Supported Metrics
Supported metrics for this workload as provided by the Kubernetes 2.0 Agent.
Metric | Description |
---|---|
haproxy_bytes_input | Total number of bytes received by HAProxy |
haproxy_bytes_output | Total number of bytes sent by HAProxy |
haproxy_connections_errors | Number of connection errors in HAProxy |
haproxy_connections_rate | Rate of new connections in HAProxy |
haproxy_connections_retries | Number of connection retries in HAProxy |
haproxy_requests_denied | Number of denied requests in HAProxy |
haproxy_requests_errors | Number of requests that resulted in errors in HAProxy |
haproxy_requests_queued | Number of requests queued in HAProxy |
haproxy_requests_rate | Rate of requests received by HAProxy |
haproxy_requests_redispatched | Number of requests redispatched by HAProxy |
haproxy_requests_total | Total number of requests received by HAProxy |
haproxy_responses_denied | Number of denied responses in HAProxy |
haproxy_responses_errors | Number of responses that resulted in errors in HAProxy |
haproxy_server_selected_total | Total number of times a server was selected in HAProxy |
haproxy_sessions_average | Average number of sessions in HAProxy |
haproxy_sessions_count | Total number of active sessions in HAProxy |
haproxy_sessions_rate | Rate of new sessions in HAProxy |