---
title: "Configure the HAProxy integration | Grafana Labs"
description: "Set up the Grafana Cloud HAProxy integration to collect frontend and backend metrics"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# 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 &gt; 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:
   
   ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```none
   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:
   
   ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```none
   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.
