Skip to main content
The HAProxy integration requires CXDOT Collector 1.4.0 or greater. HAProxy 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:

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

The HAProxy integration is enabled by default. You can configure targets either by annotating pods in your Kubernetes cluster or by listing static endpoints in your Helm values. 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:
  2. To collect from HAProxy pods in Kubernetes, add a CXDOT integration annotation to the pod template. The annotation key must end with the container name. For example, add the following annotation to your HAProxy workload:
    The Collector replaces ${target.host} with the pod IP address and ${target.port.stats} with the container port named stats. The Collector also discovers HAProxy pods that carry the app.kubernetes.io/name: haproxy label and expose the stats page on port 8404. A CXDOT integration annotation takes precedence over the label for its container. To stop collecting from a container, set haproxy: {enabled: false} in the annotation. For more information, see autodiscovery.
  3. Optional: To collect from HAProxy servers outside your Kubernetes cluster, configure static targets. For example, add the following to the values.yaml for your Helm chart:
    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 annotated pods and static targets. For example, add the following to the values.yaml for your Helm chart:
    The haproxy/edge key defines a named instance for the static targets. The bare haproxy key continues to discover pods.

Validate

To validate the HAProxy CXDOT Collector integration, follow these steps:
  1. In Metrics Explorer, run the following query:
    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:
    Confirm that the query returns the expected time series for each target.

Configuration reference

Configure one HAProxy integration instance with the following settings. In Helm values, place these settings under collection.cxdot.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: []. HAProxy stats listeners. For a host:port value, the Collector requests http://<host>:<port>/stats; for a full HTTP or HTTPS URL, it requests the URL as written. Either way it reads the CSV output.
  • 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.
  • tls Type: object. Optional. Transport layer security (TLS) settings for HTTPS targets. Certificate verification is enabled unless insecure_skip_verify is true. These settings don’t apply to HTTP targets. Discovery annotations can provide target-specific TLS settings.
  • tls.ca_file Type: string. Optional. Path to the CA cert. For a client this verifies the server certificate. For a server this verifies client certificates. If empty uses system root CA. (optional)
  • tls.ca_pem Type: string. Optional. In memory PEM encoded cert. (optional)
  • tls.cert_file Type: string. Optional. Path to the TLS cert to use for TLS required connections. (optional)
  • tls.cert_pem Type: string. Optional. In memory PEM encoded TLS cert to use for TLS required connections. (optional)
  • tls.cipher_suites Type: array of string. Optional. CipherSuites is a list of TLS cipher suites that the TLS transport can use. If left blank, a safe default list is used. See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites.
  • tls.curve_preferences Type: array of string. Optional. contains the elliptic curves that will be used in an ECDHE handshake, in preference order Defaults to empty list and “crypto/tls” defaults are used, internally.
  • tls.include_system_ca_certs_pool Type: boolean. Optional. If true, load system CA certificates pool in addition to the certificates configured in this struct.
  • tls.insecure Type: boolean. Optional. In gRPC and HTTP when set to true, this is used to disable the client transport security. See https://godoc.org/google.golang.org/grpc#WithInsecure for gRPC. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional, default false)
  • tls.insecure_skip_verify Type: boolean. Optional. InsecureSkipVerify will enable TLS but not verify the certificate.
  • tls.key_file Type: string. Optional. Path to the TLS key to use for TLS required connections. (optional)
  • tls.key_pem Type: string. Optional. In memory PEM encoded TLS key to use for TLS required connections. (optional)
  • tls.max_version Type: string. Optional. MaxVersion sets the maximum TLS version that is acceptable. If not set, refer to crypto/tls for defaults. (optional)
  • tls.min_version Type: string. Optional. MinVersion sets the minimum TLS version that is acceptable. If not set, TLS 1.2 will be used. (optional)
  • tls.reload_interval Type: duration. Optional. ReloadInterval specifies the duration after which the certificate will be reloaded If not set, it will never be reloaded (optional)
  • tls.server_name_override Type: string. Optional. ServerName requested by client for virtual hosting. This sets the ServerName in the TLSConfig. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional)
  • tls.tpm Type: object. Optional. Trusted platform module configuration
  • tls.tpm.auth Type: string. Optional. Authorization value for the trusted platform module key.
  • tls.tpm.enabled Type: boolean. Optional. Whether to use a trusted platform module for the TLS private key. If true, the Collector loads the key from the configured device or socket. If false, the Collector uses the configured key file or in-memory key.
  • tls.tpm.owner_auth Type: string. Optional. Owner authorization value for the trusted platform module.
  • tls.tpm.path Type: string. Optional. The path to the TPM device or Unix domain socket. For instance /dev/tpm0 or /dev/tpmrm0.