After you've set up HAProxy monitoring with OpenTelemetry, your data appears in New Relic within a few minutes. This page shows you how to find your HAProxy entities, explore metrics and trace data, and write NRQL queries.
Find your HAProxy data
Query your data with NRQL
Use these example NRQL queries to analyze your HAProxy data:
-- Sessions per second across frontendsFROM Metric SELECT average(haproxy.sessions.rate)WHERE haproxy.service_name = 'FRONTEND'FACET haproxy.proxy_nameTIMESERIES
-- Error rates by backendFROM Metric SELECT rate(sum(haproxy.responses.errors), 1 minute) AS 'Errors/min'WHERE haproxy.service_name = 'BACKEND'FACET haproxy.proxy_nameTIMESERIES
-- Bytes throughput (in + out)FROM Metric SELECT rate(sum(haproxy.bytes.input), 1 minute) AS 'Bytes In/min', rate(sum(haproxy.bytes.output), 1 minute) AS 'Bytes Out/min'FACET haproxy.proxy_nameTIMESERIES
-- Backend server healthFROM Metric SELECT latest(haproxy.active) AS 'Active Servers', latest(haproxy.backup) AS 'Backup Servers'WHERE haproxy.service_name = 'BACKEND'FACET haproxy.proxy_name
-- Request queue depth (indicates backend saturation)FROM Metric SELECT max(haproxy.requests.queued)WHERE haproxy.service_name = 'BACKEND'FACET haproxy.proxy_nameTIMESERIESQuery trace data with NRQL
If you've enabled distributed tracing with the HAProxy OTel filter, you can also query trace and span data:
-- HAProxy spans by nameFROM Span SELECT count(*)WHERE service.name = 'YOUR_HAPROXY_SERVICE_NAME'FACET nameSINCE 1 hour ago
-- Distributed traces flowing through HAProxy-- Shows all services participating in traces that include HAProxyFROM Span SELECT uniques(service.name)WHERE trace.id IN ( SELECT uniques(trace.id) FROM Span WHERE service.name = 'YOUR_HAPROXY_SERVICE_NAME' SINCE 30 minutes ago LIMIT 10)SINCE 30 minutes ago
-- Service relationships involving HAProxyFROM Relationship SELECT *WHERE source.entityName = 'YOUR_HAPROXY_SERVICE_NAME' OR target.entityName = 'YOUR_HAPROXY_SERVICE_NAME'SINCE 1 day agoReplace YOUR_HAPROXY_SERVICE_NAME with the service.name value configured in your HAProxy OTel filter exporter (otel.yml).
Troubleshoot data visibility
Next steps
- HAProxy distributed tracing — enable the HAProxy OTel filter for distributed tracing and service relationships
- HAProxy OTel metrics reference — complete metrics reference with descriptions
- Introduction to NRQL — learn New Relic's query language for advanced analysis
- Create NRQL alert conditions — set up alerts based on your HAProxy metrics
- Monitor self-hosted HAProxy — setup for Linux VMs or bare metal
- Monitor HAProxy on Kubernetes — automatic pod discovery for containerized environments