> ## Documentation Index
> Fetch the complete documentation index at: https://docs-xcor.paloaltonetworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HAProxy

> HAProxy connection, request, and session metrics.

The HAProxy integration requires CXDOT Collector 1.4.0 or greater.

[HAProxy](https://www.haproxy.org/) is an open source load balancer and reverse proxy
for TCP and HTTP applications. Use the HAProxy CXDOT Collector integration to collect
connection, request, and session metrics from HAProxy servers running in your
environment.

## Supported telemetry types

The HAProxy CXDOT Collector integration supports these telemetry types:

| Type | Supported |
| - | - |
| Logs | No |
| Metrics | Yes |
| Traces | No |
| Events | No |

## Prerequisites

The HAProxy CXDOT Collector integration has the following prerequisites:

* An HAProxy stats page that exposes the CSV export.
* Network access from the CXDOT collector to the HAProxy stats page.

## Configure

To configure the HAProxy CXDOT Collector integration, follow these steps:

1. Configure HAProxy to expose statistics at `/stats` on port `8404`. For example,
   add the following frontend to the HAProxy configuration:

   ```text theme={null}
   frontend stats
       bind :8404
       mode http
       stats enable
       stats uri /stats
   ```

2. Choose how the CXDOT collector finds your HAProxy servers:

   * For HAProxy pods that expose the stats page on port `8404`, add the
     `app.kubernetes.io/name: haproxy` label to the pod template.
   * For HAProxy pods or Services that use another port or stats path, add
     autodiscovery annotations that provide the HAProxy stats URL.

   For more information, see
   [autodiscovery](https://docs.chronosphere.io/ingest/cxdot-collector/autodiscovery).

3. Optional: Configure static targets to collect metrics from HAProxy servers outside
   your Kubernetes cluster. For example, add the following to the `values.yaml` for
   your Helm chart:

   ```yaml theme={null}
   config:
     integrations:
       haproxy:
         endpoints:
           - endpoint: haproxy.example.com:8404
   ```

   When you configure static targets, this integration instance collects from exactly
   those targets instead of discovered targets.

4. Optional: Configure a second integration instance to collect from both discovered
   pods and static targets. For example, add the following to the `values.yaml` for
   your Helm chart:

   ```yaml theme={null}
   config:
     integrations:
       haproxy: {}
       haproxy/edge:
         endpoints:
           - endpoint: haproxy.example.com:8404
   ```

   The `haproxy/edge` key defines a named instance for the static targets. The bare
   `haproxy` key continues to use autodiscovery.

### Validate

To validate the HAProxy CXDOT Collector integration, follow these steps:

1. In Metrics Explorer, run the following query:

   ```text theme={null}
   {"cxdot.integration.target.health", "cxdot.integration.name"="haproxy"}
   ```

   Confirm that the query returns one time series for each stats URL you configured,
   with the URL in the `cxdot.integration.target` attribute, and that each reachable
   URL reports `1`.

2. In Metrics Explorer, run the following query:

   ```text theme={null}
   count by ("server.address", "server.port") ({"haproxy.sessions.count"})
   ```

   Confirm that the query returns the expected time series for each target.

For more information about diagnosing a failing integration, see
[Troubleshooting](https://docs.chronosphere.io/ingest/cxdot-collector/troubleshooting).

## Configuration reference

Configure one HAProxy integration instance with the following settings. In Helm values, place
these settings under `config.integrations.haproxy`. In a Collector configuration file, place
them under `cxdot.integrations.haproxy`.

### Optional settings

* **`enabled`**
  Type: `boolean`. Optional. Default: `true`.
  Whether to enable this HAProxy integration instance. If true, the Collector collects metrics
  from HAProxy targets. If false, it doesn't run this integration instance.

* **`endpoints`**
  Type: `array of object`. Optional. Default: `[]`.
  Static HAProxy stats listeners as `host:port` values. The Collector requests the `/stats` path
  over HTTP and reads its CSV output. A nonempty list disables automatic discovery for this
  integration instance, and the Collector scrapes only the listed targets.

* **`endpoints[].endpoint`**
  Type: `string`. Required.
  HAProxy statistics listener as `host:port`. The Collector requests `/stats` over HTTP and
  reads its CSV output.

* **`collection_interval`**
  Type: `duration`. Optional. Default: `10s`.
  How often the Collector requests statistics from each HAProxy target.

* **`timeout`**
  Type: `duration`. Optional. Default: `10s`.
  Maximum time the Collector waits for an HAProxy statistics request to complete.

* **`disable_keep_alives`**
  Type: `boolean`. Optional. Default: `true`.
  Whether to close the connection after each statistics request. If true, the Collector closes
  the connection so that an idle connection doesn't increase `haproxy.sessions.count`. If false,
  the Collector keeps the connection open for reuse. Annotation-discovered endpoints instead
  take connection persistence from the annotation's `persist_connections`,
  `tls_use_host_header`, `headers`, and `extra_headers` fields.


## Related topics

- [CXDOT Collector integrations](/ingest/xcor/integrations/collector.md)
- [Azure metrics available in Palo Alto Networks Cortex XCOR](/ingest/xcor/integrations/server/azure/azure-metrics.md)
- [Networking](/ingest/pipeline/v2/configure/networking.md)
- [Configure Palo Alto Networks Telemetry Pipeline using Helm](/ingest/pipeline/v2/configure/helm.md)
- [Coralogix destination plugin](/ingest/pipeline/plugins/destination-plugins/coralogix.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.