> ## 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.

# RabbitMQ broker logs with OpenTelemetry

> Collect self-hosted RabbitMQ broker logs and connection events with the OpenTelemetry Collector and forward them to Bronto to monitor queues, consumers, and errors.

Collect logs from a self-hosted RabbitMQ broker — connections, channel activity, node events, and errors — with the OpenTelemetry Collector. 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))
* RabbitMQ writing logs to a file (default: `/var/log/rabbitmq/rabbit@<hostname>.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

RabbitMQ entries begin with a timestamp, and some span multiple lines (crash reports). Use `multiline` keyed on the leading timestamp:

```yaml /etc/otel/config.yaml theme={"dark"}
receivers:
  filelog/rabbitmq:
    include:
      - /var/log/rabbitmq/*.log
    multiline:
      line_start_pattern: '^\d{4}-\d{2}-\d{2}'
    resource:
      service.name: rabbitmq
      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/rabbitmq]
      processors: [batch]
      exporters: [otlphttp/brontologs]
```

Set `<REGION>` to `eu` or `us`.

## What you will see in Bronto

Open [Search](https://app.bronto.io/search) and filter by `service.name = rabbitmq`. Each line carries a timestamp, log level (`[info]`, `[warning]`, `[error]`), the Erlang process id, and the message — connection open/close, channel errors, queue declarations, and node lifecycle events. Bronto's [Custom Parser](/core-features/custom-parser) extracts these fields server-side.

## Troubleshooting

* **Want structured fields at the source?** RabbitMQ's default format is plain text. For JSON logs (RabbitMQ 3.9+), set `log.file.formatter = json` in `rabbitmq.conf`, then add a `json_parser` operator to the receiver.
* For general issues, see [OTel Collector troubleshooting](https://opentelemetry.io/docs/collector/troubleshooting/).

## Alternative: Fluent Bit

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

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

[OUTPUT]
    name        http
    match       rabbitmq
    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    rabbitmq
    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.
