Better Stack HAProxy logging

Start logging in 2 minutes

Collect logs and metrics from your HAProxy using Vector.

Select your platform:

Install and configure Vector on Ubuntu or Debian:

Set up Vector
curl -sSL https://telemetry.betterstack.com/setup-vector/haproxy/$SOURCE_TOKEN \
  -o /tmp/setup-vector.sh && \
  bash /tmp/setup-vector.sh


Curious about what the script does?

  • Installs Vector using official package.
  • Configures Vector for your Better Stack source.
  • Enables and restarts Vector.

The script will ask for confirmation before making any changes.

You should see your logs in Better Stack → Live tail.

Check out your metrics in the HAProxy dashboard.

Collect metrics

To collect HAProxy metrics, enable the stats frontend by adding the following to /etc/haproxy/haproxy.cfg:

/etc/haproxy/haproxy.cfg
frontend stats
    bind 127.0.0.1:8404
    mode http
    stats enable
    stats uri /haproxy_stats
    stats refresh 10s
    stats show-node

Then restart HAProxy to apply the changes:

Restart HAProxy
sudo systemctl restart haproxy

The stats frontend is bound to 127.0.0.1 so it is only accessible locally. Vector scrapes metrics from this endpoint automatically.

Need help?

Please let us know at hello@betterstack.com.
We're happy to help! 🙏

Additional information

Looking for manual instructions to set up Vector?

Find step-by-step instructions in our dedicated Vector guide.