Path

Set up the Grafana Cloud HAProxy integration to collect frontend and backend metrics

Estimated time: 2 min

Configure the HAProxy integration

Now that HAProxy is exposing metrics on port 8404, copy the Alloy snippet from the HAProxy integration page and add it to the Alloy configuration file.

Return to the HAProxy integration page in Grafana Cloud to complete the configuration.

  1. If you navigated away, return to the HAProxy integration page:

    a. Click Connections > Add new connection in the left-side menu

    b. Search for HAProxy and click the tile

    c. Click Proceed to install integration if you completed the Alloy installation step

  2. Scroll to the Set up Grafana Alloy to use the HAProxy integration section.

  3. At the bottom of the snippet, click Copy to clipboard.

  4. On the HAProxy server, open the Alloy configuration file:

    sudo nano /etc/alloy/config.alloy
  5. Paste the snippet at the end of the file. It scrapes localhost:8404, which matches the stats frontend you added when you configured HAProxy.

    If HAProxy and Alloy are on different machines, change __address__ from localhost:8404 to the HAProxy host and port.

  6. Save the file, then restart Alloy:

    sudo systemctl restart alloy.service
  7. In Grafana Cloud, click Test connection. A successful test shows that Alloy is collecting HAProxy metrics and sending them to Grafana Cloud.

The integration is now configured. Alloy begins collecting HAProxy frontend and backend metrics and forwarding them to your Grafana Cloud stack.