> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bronto.io/llms.txt
> Use this file to discover all available pages before exploring further.

# HAProxy access logs with OpenTelemetry

> Collect HAProxy access and error logs with the OpenTelemetry Collector and forward them to Bronto to monitor request latency, backend health, and traffic patterns.

Collect HAProxy access logs — frontend/backend connections, timing, and status codes — with the OpenTelemetry Collector. HAProxy emits logs over syslog, so the usual setup is HAProxy → rsyslog → a file the Collector tails. The same Collector can also forward traces and metrics from your apps — see [Connect OpenTelemetry Collector to Bronto](/agent-setup/open-telemetry).

## Prerequisites

* A Bronto account and API key ([how to create one](/Account-Management/API-Keys#create-a-new-api-key))
* HAProxy logging to local syslog (`log 127.0.0.1 local0` in `haproxy.cfg`), with rsyslog writing `local0` to `/var/log/haproxy.log`
* An [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/installation/) (recommended) or [Fluent Bit](https://docs.fluentbit.io/manual/installation/getting-started-with-fluent-bit) installed on the same host

## Configure the Collector

```yaml /etc/otel/config.yaml theme={"dark"}
receivers:
  filelog/haproxy:
    include:
      - /var/log/haproxy.log
    resource:
      service.name: haproxy
      service.namespace: <YOUR_COLLECTION_NAME>

processors:
  batch:

exporters:
  otlphttp/brontologs:
    logs_endpoint: "https://ingestion.<REGION>.bronto.io/v1/logs"
    compression: gzip
    headers:
      x-bronto-api-key: <YOUR_API_KEY>

service:
  pipelines:
    logs:
      receivers: [filelog/haproxy]
      processors: [batch]
      exporters: [otlphttp/brontologs]
```

Set `<REGION>` to `eu` or `us`. No rsyslog on the host? Receive HAProxy's syslog stream directly with the OTel Collector's `syslog` receiver instead of `filelog`.

## What you will see in Bronto

Open [Search](https://app.bronto.io/search) and filter by `service.name = haproxy`. The HTTP log format includes the client IP, the frontend and backend names, the chosen server, connection and response timers (queue, connect, response, total), the status code, bytes, and the session termination state. Bronto's [Custom Parser](/core-features/custom-parser) has built-in HAProxy support, so these fields are extracted automatically.

## Troubleshooting

* **No logs?** Confirm `log 127.0.0.1 local0` is set in `haproxy.cfg` and that rsyslog routes `local0.*` to `/var/log/haproxy.log`, then restart both services.
* For general issues, see [OTel Collector troubleshooting](https://opentelemetry.io/docs/collector/troubleshooting/).

## Alternative: Fluent Bit

If you already run Fluent Bit, tail the HAProxy log file and forward it over HTTP:

```ini fluent-bit.conf theme={"dark"}
[INPUT]
    name  tail
    path  /var/log/haproxy.log
    tag   haproxy

[OUTPUT]
    name        http
    match       haproxy
    host        ingestion.<REGION>.bronto.io
    port        443
    tls         on
    format      json_lines
    compress    gzip
    header      x-bronto-api-key    <YOUR_API_KEY>
    header      x-bronto-dataset    haproxy
    header      x-bronto-collection <YOUR_COLLECTION_NAME>
```

Set **Format** to `json_lines`, not `json`. See [Connect Fluent Bit to Bronto](/agent-setup/fluent-bit) for installation.
