---
title: HAProxy OTel metrics reference
source: https://docs.newrelic.com/docs/opentelemetry/integrations/haproxy/metrics-reference
---

This page provides a complete reference for all HAProxy metrics collected via OpenTelemetry, including the haproxyreceiver and Prometheus receiver paths.

## Overview [#overview]

The HAProxy OpenTelemetry integration collects metrics from the HAProxy CSV stats endpoint via the [haproxyreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/haproxyreceiver). Metrics are organized into two tiers:

-   **Default metrics (17)**: Collected automatically with default configuration — sufficient for most monitoring use cases
-   **Optional metrics (16)**: Disabled by default, enabled individually in the receiver `metrics` section — useful for detailed debugging and capacity planning

When using the NRDOT guided install, you can choose between two configurations:

-   **Optimized** (lower ingest): 17 default metrics, 60s collection interval, optimization processors applied
-   **Comprehensive** (full detail): 27 metrics (17 default + 10 optional), 15s collection interval

> #### 💡 TIP
>
> To enable optional metrics, add them to the `metrics` section of your haproxy receiver configuration with `enabled: true`. See [Monitor self-hosted HAProxy with OpenTelemetry](https://docs.newrelic.com/docs/opentelemetry/integrations/haproxy/self-hosted/) for configuration details.

## Default metrics [#default-metrics]

These 17 metrics are collected with default configuration (no `metrics` section needed).

| Metric name                     | Description                                                                                | Type             | Unit              |
| ------------------------------- | ------------------------------------------------------------------------------------------ | ---------------- | ----------------- |
| `haproxy.bytes.input`           | Total bytes received by the proxy (collected per frontend, backend, and server)            | Sum (cumulative) | By                |
| `haproxy.bytes.output`          | Total bytes sent by the proxy (collected per frontend, backend, and server)                | Sum (cumulative) | By                |
| `haproxy.connections.errors`    | Total number of connection errors (backend and server only)                                | Sum (cumulative) | '{errors}'        |
| `haproxy.connections.rate`      | Number of connections per second over the last elapsed second (frontend only)              | Gauge            | '{connections}/s' |
| `haproxy.connections.retries`   | Total number of connection retries (backend and server only)                               | Sum (cumulative) | '{retries}'       |
| `haproxy.requests.denied`       | Total number of denied requests (frontend and backend)                                     | Sum (cumulative) | '{requests}'      |
| `haproxy.requests.errors`       | Total number of request errors (frontend only)                                             | Sum (cumulative) | '{errors}'        |
| `haproxy.requests.queued`       | Current number of queued requests (backend and server only)                                | Gauge            | '{requests}'      |
| `haproxy.requests.rate`         | Number of HTTP requests per second over the last elapsed second (frontend only)            | Gauge            | '{requests}/s'    |
| `haproxy.requests.redispatched` | Total number of request redispatches (backend and server only)                             | Sum (cumulative) | '{requests}'      |
| `haproxy.requests.total`        | Total number of HTTP requests received (frontend and backend)                              | Sum (cumulative) | '{requests}'      |
| `haproxy.responses.denied`      | Total number of denied responses (frontend, backend, and server)                           | Sum (cumulative) | '{responses}'     |
| `haproxy.responses.errors`      | Total number of response errors (backend and server only)                                  | Sum (cumulative) | '{errors}'        |
| `haproxy.server_selected.total` | Total number of times a server was selected for load balancing (backend and server)        | Sum (cumulative) | '{selections}'    |
| `haproxy.sessions.average`      | Average total session time over the last 1024 requests, in seconds (backend and server)    | Gauge            | s                 |
| `haproxy.sessions.count`        | Current number of active sessions (frontend, backend, and server)                          | Gauge            | '{sessions}'      |
| `haproxy.sessions.rate`         | Number of sessions per second over the last elapsed second (frontend, backend, and server) | Gauge            | '{sessions}/s'    |

## Optional metrics [#optional-metrics]

These 16 metrics are disabled by default. Enable them individually in your collector configuration by setting `enabled: true` in the receiver's `metrics` section.

The NRDOT comprehensive configuration enables the first 10 of these (marked with **[C]**).

| Metric name                                | Description                                             | Type             | Unit              |
| ------------------------------------------ | ------------------------------------------------------- | ---------------- | ----------------- |
| `haproxy.connections.average_time` **[C]** | Average connection time in seconds (latency monitoring) | Gauge            | s                 |
| `haproxy.requests.average_time` **[C]**    | Average queue time for requests in seconds              | Gauge            | s                 |
| `haproxy.responses.average_time` **[C]**   | Average response time in seconds                        | Gauge            | s                 |
| `haproxy.active` **[C]**                   | Number of active servers in a backend                   | Gauge            | '{servers}'       |
| `haproxy.backup` **[C]**                   | Number of backup servers in a backend                   | Gauge            | '{servers}'       |
| `haproxy.downtime` **[C]**                 | Total downtime in seconds                               | Sum (cumulative) | s                 |
| `haproxy.failed_checks` **[C]**            | Total number of failed health checks                    | Sum (cumulative) | '{checks}'        |
| `haproxy.weight` **[C]**                   | Server weight (used in load balancing decisions)        | Gauge            | '{weight}'        |
| `haproxy.sessions.total` **[C]**           | Total cumulative number of sessions                     | Sum (cumulative) | '{sessions}'      |
| `haproxy.connections.total` **[C]**        | Total cumulative number of connections                  | Sum (cumulative) | '{connections}'   |
| `haproxy.compression.input`                | Total number of bytes submitted to the compressor       | Sum (cumulative) | By                |
| `haproxy.compression.output`               | Total number of bytes emitted by the compressor         | Sum (cumulative) | By                |
| `haproxy.compression.bypass`               | Total number of bytes that bypassed compression         | Sum (cumulative) | By                |
| `haproxy.compression.responses`            | Total number of HTTP responses that were compressed     | Sum (cumulative) | '{responses}'     |
| `haproxy.clients.canceled`                 | Total number of data transfers aborted by the client    | Sum (cumulative) | '{cancellations}' |
| `haproxy.sessions.limit`                   | Configured session limit for the proxy                  | Gauge            | '{sessions}'      |

## Resource attributes [#resource-attributes]

The following resource attributes are attached to all HAProxy metrics, providing context for filtering and grouping.

| Attribute              | Description                                                                                                                                              | Example value                                           |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| `haproxy.proxy_name`   | Name of the HAProxy proxy (from the frontend/backend/listen section name in haproxy.cfg)                                                                 | `http_front`, `flask_backends`, `stats`                 |
| `haproxy.service_name` | Type identifier or server name: `FRONTEND` for frontend aggregates, `BACKEND` for backend aggregates, or the specific server name for per-server metrics | `FRONTEND`, `BACKEND`, `backend-app-a`, `backend-app-b` |
| `haproxy.addr`         | The stats endpoint URL that was scraped (used as part of entity identifier)                                                                              | `http://localhost:8404/stats`                           |
| `host.id`              | Unique identifier of the host (from `/etc/machine-id` on Linux)                                                                                          | `ec23da5ead46571f2c3a9771b093658b`                      |
| `host.name`            | Hostname of the machine running the collector                                                                                                            | `ip-172-31-7-195.ap-southeast-2.compute.internal`       |
| `os.type`              | Operating system type                                                                                                                                    | `linux`                                                 |

**Entity identifier:** The HAProxy entity in New Relic is synthesized from `host.id` + `haproxy.addr` (for example `ec23da5ead46571f2c3a9771b093658b:http://localhost:8404/stats`).

## Prometheus metric mapping [#prometheus-mapping]

If you're using the Prometheus receiver path, the following table shows how HAProxy Prometheus metric names map to the OTel haproxyreceiver equivalents. Each OTel metric may have multiple Prometheus sources (one per tier: frontend, backend, server).

| OTel metric                     | Prometheus frontend                       | Prometheus backend                           | Prometheus server                           |
| ------------------------------- | ----------------------------------------- | -------------------------------------------- | ------------------------------------------- |
| `haproxy.bytes.input`           | `haproxy_frontend_bytes_in_total`         | `haproxy_backend_bytes_in_total`             | `haproxy_server_bytes_in_total`             |
| `haproxy.bytes.output`          | `haproxy_frontend_bytes_out_total`        | `haproxy_backend_bytes_out_total`            | `haproxy_server_bytes_out_total`            |
| `haproxy.connections.errors`    | —                                         | `haproxy_backend_connection_errors_total`    | `haproxy_server_connection_errors_total`    |
| `haproxy.connections.rate`      | `haproxy_frontend_connections_rate_max`   | —                                            | —                                           |
| `haproxy.connections.retries`   | —                                         | `haproxy_backend_retry_warnings_total`       | `haproxy_server_retry_warnings_total`       |
| `haproxy.requests.denied`       | `haproxy_frontend_requests_denied_total`  | `haproxy_backend_requests_denied_total`      | —                                           |
| `haproxy.requests.errors`       | `haproxy_frontend_request_errors_total`   | —                                            | —                                           |
| `haproxy.requests.queued`       | —                                         | `haproxy_backend_current_queue`              | `haproxy_server_current_queue`              |
| `haproxy.requests.rate`         | `haproxy_frontend_http_requests_rate_max` | —                                            | —                                           |
| `haproxy.requests.redispatched` | —                                         | `haproxy_backend_redispatch_warnings_total`  | `haproxy_server_redispatch_warnings_total`  |
| `haproxy.requests.total`        | `haproxy_frontend_http_requests_total`    | `haproxy_backend_http_requests_total`        | —                                           |
| `haproxy.responses.denied`      | `haproxy_frontend_responses_denied_total` | `haproxy_backend_responses_denied_total`     | `haproxy_server_responses_denied_total`     |
| `haproxy.responses.errors`      | —                                         | `haproxy_backend_response_errors_total`      | `haproxy_server_response_errors_total`      |
| `haproxy.server_selected.total` | —                                         | `haproxy_backend_loadbalanced_total`         | `haproxy_server_loadbalanced_total`         |
| `haproxy.sessions.average`      | —                                         | `haproxy_backend_total_time_average_seconds` | `haproxy_server_total_time_average_seconds` |
| `haproxy.sessions.count`        | `haproxy_frontend_current_sessions`       | `haproxy_backend_current_sessions`           | `haproxy_server_current_sessions`           |
| `haproxy.sessions.rate`         | `haproxy_frontend_max_session_rate`       | `haproxy_backend_max_session_rate`           | `haproxy_server_max_session_rate`           |

> #### ⚠️ IMPORTANT
>
> **Known limitations of the Prometheus path:**
>
> -   **No per-status-code FACET**: The haproxyreceiver parses `hrsp_*` CSV fields into a `status_code` attribute on `haproxy.requests.total`. The Prometheus path does not support this — HTTP response code breakdown is available only as separate metrics (`haproxy_frontend_http_responses_total{code="2xx"}`) not included in the transform config.
> -   **Rate metrics are lifetime maximums**: `haproxy.connections.rate` maps to `haproxy_frontend_connections_rate_max` and `haproxy.requests.rate` maps to `haproxy_frontend_http_requests_rate_max`. These are lifetime max values, not instantaneous rates. For true current rates, use the `rate()` NRQL function on cumulative counter metrics.
> -   **~136 Prometheus metrics have no OTel equivalent**: HAProxy's Prometheus endpoint exposes ~204 metrics. Only 36 are mapped to the 17 OTel default metrics (across frontend/backend/server tiers). The remainder (process internals, health check details, DNS resolver stats) have no haproxyreceiver equivalent.

## Sample NRQL queries [#sample-queries]

Use these queries to explore your HAProxy metrics in New Relic:

```sql
-- Current sessions across all frontends
FROM Metric SELECT latest(haproxy.sessions.count)
FACET haproxy.proxy_name
WHERE haproxy.service_name = 'FRONTEND'

-- Request rate per frontend over time
FROM Metric SELECT average(haproxy.requests.rate)
FACET haproxy.proxy_name
WHERE haproxy.service_name = 'FRONTEND'
TIMESERIES

-- Backend error rate (responses.errors as rate)
FROM Metric SELECT rate(sum(haproxy.responses.errors), 1 second)
FACET haproxy.proxy_name
WHERE haproxy.service_name = 'BACKEND'
TIMESERIES

-- Bytes throughput per backend
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_name
WHERE haproxy.service_name = 'BACKEND'

-- Average session time per backend (latency indicator)
FROM Metric SELECT average(haproxy.sessions.average)
FACET haproxy.proxy_name
WHERE haproxy.service_name = 'BACKEND'

-- Per-server session count (individual backend servers)
FROM Metric SELECT latest(haproxy.sessions.count)
FACET haproxy.proxy_name, haproxy.service_name
WHERE haproxy.service_name NOT IN ('FRONTEND', 'BACKEND')

-- Queued requests (indicates backend saturation)
FROM Metric SELECT max(haproxy.requests.queued)
FACET haproxy.proxy_name
WHERE haproxy.service_name = 'BACKEND'
TIMESERIES
```

## Next steps [#next-steps]

-   [Find and query your HAProxy data](https://docs.newrelic.com/docs/opentelemetry/integrations/haproxy/find-and-query-data/) — dashboards, NRQL queries, and data navigation
-   [Monitor self-hosted HAProxy](https://docs.newrelic.com/docs/opentelemetry/integrations/haproxy/self-hosted/) — setup for Linux VMs or bare metal
-   [Monitor HAProxy on Kubernetes](https://docs.newrelic.com/docs/opentelemetry/integrations/haproxy/kubernetes/) — automatic pod discovery for containerized environments
-   [Create NRQL alert conditions](https://docs.newrelic.com/docs/alerts/create-alert/create-alert-condition/create-nrql-alert-conditions/) — set up alerts based on your HAProxy metrics
