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

# RabbitMQ

> RabbitMQ message, connection, channel, queue, and Erlang runtime metrics.

The RabbitMQ integration requires CXDOT Collector 1.18.0 or greater.

[RabbitMQ](https://www.rabbitmq.com/) is an open source message broker. Use the RabbitMQ
CXDOT Collector integration to collect connection, channel, queue, message, and Erlang
runtime metrics from RabbitMQ nodes running in your environment.

The RabbitMQ CXDOT Collector integration supports RabbitMQ 4.3 or greater.

## Supported telemetry types

The RabbitMQ CXDOT Collector integration supports these telemetry types:

| Type | Supported |
| - | - |
| Logs | No |
| Metrics | Yes |
| Traces | No |
| Events | No |

## Prerequisites

The RabbitMQ CXDOT Collector integration has the following prerequisites:

* Enable the [RabbitMQ Prometheus plugin](https://www.rabbitmq.com/docs/prometheus),
  `rabbitmq_prometheus`, on each node. The integration collects metrics from this
  plugin, not from the management plugin's HTTP API. The official RabbitMQ container
  images and the RabbitMQ Cluster Operator for Kubernetes enable the plugin by default.
  To confirm that a node has the plugin enabled, run the following command on the node:

  ```shell theme={null}
  rabbitmq-plugins is_enabled rabbitmq_prometheus
  ```

* Keep the plugin's default aggregated output: leave
  `prometheus.return_per_object_metrics` unset or set to `false` in `rabbitmq.conf`.
  The integration collects node-level totals from the `/metrics` endpoint and doesn't
  support the plugin's per-object metrics, which break those totals down by individual
  queue, exchange, or connection.

* Make the plugin's metrics endpoint, port `15692` by default, reachable from the CXDOT
  Collector. The integration doesn't send credentials, so the endpoint must accept
  requests without authentication.

* Serve metrics without requiring a client certificate. The integration verifies a
  node's TLS certificate over HTTPS but can't present a client certificate of its own.
  A node whose metrics listener requires one refuses the connection.

## Configure

The RabbitMQ integration is enabled by default. You can configure targets either by
annotating pods in your Kubernetes cluster or by listing static endpoints in your Helm
values. To configure the RabbitMQ CXDOT Collector integration, follow these steps:

1. To collect from RabbitMQ pods in Kubernetes, add a CXDOT integration annotation to the
   pod template. The annotation key must end with the container name. For example, add
   the following annotation to your RabbitMQ workload:

   ```yaml theme={null}
   spec:
     template:
       metadata:
         annotations:
           integrations.cxdot.paloaltonetworks.com/rabbitmq: |
             schema_version: v1.17
             rabbitmq:
               endpoints:
                 - endpoint: ${target.host}:${target.port.prometheus}
       spec:
         containers:
           - name: rabbitmq
             image: rabbitmq:4.4
             ports:
               - name: prometheus
                 containerPort: 15692
   ```

   The Collector replaces `${target.host}` with the pod IP address and
   `${target.port.prometheus}` with the container port named `prometheus`.

   The Collector also discovers RabbitMQ pods that carry the
   `app.kubernetes.io/name: rabbitmq` label and listen on port `15692`. A CXDOT
   integration annotation takes precedence over the label for its container. To stop
   collecting from a container, set `rabbitmq: {enabled: false}` in the annotation.
   Metrics from each discovered pod include that pod's Kubernetes metadata. For more
   information, see
   [autodiscovery](https://docs-xcor.paloaltonetworks.com/ingest/xcor/collector/discover/kubernetes.md).

2. Optional: To collect from RabbitMQ nodes outside your Kubernetes cluster, configure
   static targets. For example, add the following to the Helm values for your CXDOT
   Collector:

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         rabbitmq:
           endpoints:
             - endpoint: rabbitmq-0.example.com:15692
             - endpoint: rabbitmq-1.example.com:15692
   ```

   When you configure static targets, this integration instance collects from exactly
   those targets instead of discovered targets. Each node reports only its own metrics,
   so list every node in your RabbitMQ cluster, each by an address that reaches that node
   alone rather than a load balancer or a Kubernetes Service.

3. Optional: Configure a second integration instance to collect from both annotated
   pods and static targets. For example, add the following to the Helm values for your
   CXDOT Collector:

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         rabbitmq: {}
         rabbitmq/external:
           endpoints:
             - endpoint: rabbitmq-0.example.com:15692
             - endpoint: rabbitmq-1.example.com:15692
   ```

   The `rabbitmq/external` key defines a named instance for the static targets. The bare
   `rabbitmq` key continues to discover pods.

### Validate

To validate the RabbitMQ CXDOT Collector integration, follow these steps:

1. In Metrics Explorer, run the following query:

   ```text theme={null}
   {"cxdot.integration.target.health", "cxdot.integration.name"="rabbitmq"}
   ```

   Confirm that the query returns one time series for each RabbitMQ node you expect,
   with the requested URL in the `cxdot.integration.target` attribute, and that each
   reachable node reports `1`.

2. In Metrics Explorer, run the following query:

   ```text theme={null}
   sum by ("rabbitmq.cluster.name", "rabbitmq.node.name") ({"rabbitmq.connection.count"})
   ```

   Confirm that the query returns one time series for each RabbitMQ node, identified by
   the `rabbitmq.node.name` attribute.

3. Optional: Open the Overview dashboard that the integration provides, which shows node
   resources and limits, connections, channels, consumers, and the flow of messages
   through channels and queues. Confirm that its panels show data for your nodes.

### Troubleshooting

* Stream metrics are missing: The stream protocol's metrics, such as stream errors and
  consumer offset lag, appear only on nodes with the `rabbitmq_stream` plugin enabled.
  Nodes without the plugin don't report them.

## Configuration reference

Configure one RabbitMQ integration instance with the following settings. In Helm values, place
these settings under `collection.cxdot.integrations.rabbitmq`. In a Collector configuration
file, place them under `cxdot.integrations.rabbitmq`.

### Optional settings

* **`enabled`**
  Type: `boolean`. Optional. Default: `true`.
  Whether to enable this RabbitMQ integration instance. If true, the Collector collects metrics
  from the RabbitMQ nodes that this instance is configured for. If false, the Collector doesn't
  run this integration instance.

* **`endpoints`**
  Type: `array of object`. Optional. Default: `[]`.
  RabbitMQ nodes to monitor, by the address of each node's Prometheus metrics endpoint, which
  the `rabbitmq_prometheus` plugin serves on port `15692` by default. Specify `host:port` to
  request the `/metrics` path over HTTP, or a full HTTP or HTTPS URL. For a URL without a path,
  the Collector requests `/metrics`. Each node reports only its own metrics, so list every node
  of a cluster, each by an address that reaches that node alone.

* **`endpoints[].endpoint`**
  Type: `string`. Required.
  Address of one RabbitMQ node's Prometheus metrics endpoint, as `host:port` or a full HTTP or
  HTTPS URL.

* **`collection_interval`**
  Type: `duration`. Optional. Default: `15s`.
  How often the integration collects metrics from each RabbitMQ node.

* **`timeout`**
  Type: `duration`. Optional. Default: `10s`.
  Maximum time the Collector waits for one collection from a RabbitMQ node. The value must be
  greater than zero. A value longer than `collection_interval` is lowered to
  `collection_interval`.

* **`tls`**
  Type: `object`. Optional.
  Transport layer security (TLS) settings for HTTPS endpoints. The Collector verifies
  certificates unless `insecure_skip_verify` is `true`. These settings don't apply to HTTP
  endpoints.

* **`tls.ca_file`**
  Type: `string`. Optional.
  Path to a PEM-encoded certificate authority (CA) certificate file used to verify the RabbitMQ
  node's server certificate. If set, the Collector trusts only the certificate authorities in
  this file instead of the system certificate authority pool.

* **`tls.insecure_skip_verify`**
  Type: `boolean`. Optional.
  Whether to skip verification of the RabbitMQ node's server certificate. If true, the
  connection is encrypted but isn't authenticated and is vulnerable to man-in-the-middle
  attacks. If false, the Collector verifies the server certificate.

* **`tls.server_name`**
  Type: `string`. Optional.
  Server name to verify in the RabbitMQ node's server certificate instead of the endpoint
  hostname. The Collector also sends this name as the TLS server name indication. Use this
  setting when the certificate name differs from the endpoint hostname.

* **`max_samples`**
  Type: `integer`. Optional. Default: `0`. Minimum: `0`.
  Maximum number of samples accepted from one collection. A value of `0`, the default, means no
  limit. A collection that exceeds the limit fails instead of returning an incomplete set of
  samples.

* **`follow_redirects`**
  Type: `boolean`. Optional. Default: `true`.
  Whether to follow HTTP redirects. If false, a redirect causes the collection to fail.

* **`labels`**
  Type: `object`. Optional.
  Settings that drop metric samples based on their label values.

* **`labels.sample_drop_rules`**
  Type: `object`. Optional. Default: `{}`.
  Samples to drop, as a map from a label name, as RabbitMQ exposes it (for example `protocol` or
  `queue_type`), to a list of regular expressions matched against the label's whole value. A
  sample is dropped when any listed label matches. To drop a sample whenever the label has a
  non-empty value, use `.+`.


## Related topics

- [CXDOT Collector integrations](https://docs-xcor.paloaltonetworks.com/ingest/xcor/integrations/collector.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.