Integration
HAProxy
Requests and responses, backend servers up and down, queues, response time and every HTTP log line with its status, backend and timers.
- Category: Web servers
- How data is sent: Logthread Agent
- Runs on: Linux
- Status: Beta
How it works#
- Answer a few questions. They only fill in the setup steps. Nothing on this page connects to your servers: Logthread never reaches into your network.
- Run one command on the HAProxy machine. The next page shows the command with this connector's ingest key filled in. It downloads the Logthread Agent from downloads.logthread.com and installs it as a service (Linux, as root with sudo). No other download.
- Data arrives. Everything is collected inside your environment. It is sent over outbound HTTPS (port 443) to ingest.logthread.com. Nothing is opened to the internet: no inbound ports, VPN or public access to your servers. The connection page shows what has arrived and turns Active with the first record.
What you answer#
| Question | Answer | Notes |
|---|---|---|
| Metrics address (optional) | Text | Default: 127.0.0.1:8404. The frontend that serves the Prometheus exporter. |
| Log file (optional) | Text | Default: /var/log/haproxy.log. |
| Labels (optional) | Text | To find and group servers on the Agents page, for example env=prod. |
| Manage this agent from Logthread | Yes or no | Change what it sends later from the Agents page, without signing in to the server. Default: Yes. |
Setup#
These are the steps for the default answers. In the app, they follow your answers, and the connector's ingest key replaces YOUR_INGEST_KEY.
Step 1. Turn on the metrics and the HTTP log. The built-in Prometheus exporter (HAProxy 2.4 or later) and option httplog, which writes one line per request (frontends in mode tcp are not parsed). The Debian and Ubuntu packages already send local0 to /var/log/haproxy.log through rsyslog; elsewhere add "local0.* /var/log/haproxy.log" to rsyslog.
haproxy.cfg:
# In your existing "global" section: log /dev/log local0
# In your existing "defaults" section, or in each HTTP frontend, add:
# log global
# option httplog
# (A new "defaults" section applies only to proxies declared after it.)
# New section: the exporter, on this host only. "no log" keeps the agent's scrapes out of the log.
frontend logthread_metrics
bind 127.0.0.1:8404
no log
http-request use-service prometheus-exporter if { path /metrics }
# then: sudo haproxy -c -f /etc/haproxy/haproxy.cfg && sudo systemctl reload haproxyStep 2. Install the Logthread Agent. On the HAProxy host: it installs the agent with the HAProxy and Linux host profiles. It scrapes 127.0.0.1:8404/metrics and reads /var/log/haproxy.log.
curl -sSL https://downloads.logthread.com/agent/install.sh | sudo sh -s -- \
--key YOUR_INGEST_KEY --profiles linux-host,haproxy --fleetStep 3. Parse the log. Once lines arrive, attach the HAProxy parser (Then add, below) so status, method, path, the backend and the five timers are fields.
Step 4. If it runs in a container. The agent reads a log file and a metrics address on the host. Mount the log folder from the host into the container and publish the metrics port to the host on loopback only, "-p 127.0.0.1:PORT:PORT" (set the metrics address above to it). Never publish an admin or metrics port on a public interface. HAProxy writes its log to a syslog socket or stdout, not a file, so in a container use the Docker connector for the log and this profile for the metrics: bind :8404 in the container (publish it as -p 127.0.0.1:8404:8404). Instead of a file, the Docker connector reads the container output: the parser applies to those lines, but they arrive as service "docker", so this integration's dashboard and alert filters (service:<name>) do not see them until you edit those filters. Mounting the log folder is the recommended way.
Check that it works#
The connection page under Integrations counts what has arrived and turns Active with the first record. In Explore, search service:haproxy.
Then add#
Each is one click on the connection page and opens with your data, so you can check it before saving.
- Dashboard: HAProxy: Requests and responses by status class, backend servers up and down, queues and response time from the built-in Prometheus exporter, and the HTTP log (with the haproxy-http parser). Logs read by the Docker connector arrive as service docker: mount the log folder instead, or edit the filters of the log panels.
- Parser: haproxy-http (Pipelines → Library)
- Alert: HAProxy 5xx responses:
service:haproxy status>=500, at least 20 in 10 minutes
Price#
The integration itself has no charge. What it sends is billed as data ingested, ₹85 ($0.90) per GB on every plan, like any other data; parsing, detections and the dashboard add nothing. See Prices.
Set it up under Integrations in the app, or from an AI agent with MCP (add_integration). All integrations: Integrations guide. Next: find what it sends in Explore and live tail.