# Grafana Cloud

The Grafana Cloud integration allows you to export **Prometheus metrics** from your CloudAMQP cluster to Grafana Cloud, using Prometheus remote write. Available on RabbitMQ and LavinMQ dedicated instances.

Link: [https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-prometheus/](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-prometheus/)

## Setup

1. Sign in to the [Grafana Cloud Portal](https://grafana.com/auth/sign-in) and select your stack from the organization overview.
2. Click **Send Metrics** on the **Prometheus** tile. You will find your **remote write endpoint** (e.g. `https://prometheus-prod-<region>.grafana.net/api/prom/push`), your numeric **instance ID,** and the option to generate an **API token.**
3. Generate an API token with at minimum the `metrics:write` scope, or use a Service Account token with the `MetricsPublisher` role.
4. Enter the endpoint, instance ID, and API token in the CloudAMQP console and click **Save.**

The instance ID is used as the username and the API token as the password when authenticating against Grafana Cloud. Note that the Prometheus instance ID differs from the one used by the [Grafana Cloud (Loki) log integration](/docs/logs-grafana/).

## Querying your metrics

Once connected, open **Explore** in Grafana, select your Prometheus data source, and query by cluster or node:

```promql
rabbitmq_queue_messages_ready{cluster="your-cluster-name"}
system_cpu_utilization_ratio{instance="your-cluster-name-01"}
```

All metrics are exported with the labels/tags instance and cluster, which are populated with the name of the server and cluster. You can also set custom tags when configuring the integration.

### Exported server metrics

| Metric | Metric labels | CloudAMQP labels |
| --- | --- | --- |
| system_cpu_utilization_ratio | state | instance, cluster |
| system_disk_io_bytes_total | direction | instance, cluster |
| system_disk_operation_time_seconds_total | direction | instance, cluster |
| system_disk_operations_total | direction | instance, cluster |
| system_filesystem_usage_bytes | state | instance, cluster |
| system_filesystem_utilization_ratio | &nbsp; | instance, cluster |
| system_memory_usage_bytes | state | instance, cluster |
| system_memory_limit_bytes | &nbsp; | instance, cluster |
| system_network_io_bytes_total | direction | instance, cluster |
| system_paging_usage_bytes | state | instance, cluster |

### Exported LavinMQ metrics

| Metric | Metric labels | CloudAMQP labels |
| --- | --- | --- |
| lavinmq_global_messages_acknowledged_total | protocol, queue_type | instance, cluster |
| lavinmq_global_messages_delivered_total | protocol, queue_type | instance, cluster |
| lavinmq_global_messages_redelivered_total | protocol, queue_type | instance, cluster |
| lavinmq_global_messages_confirmed_total | protocol | instance, cluster |
| lavinmq_connections | &nbsp; | instance, cluster |
| lavinmq_channels | &nbsp; | instance, cluster |
| lavinmq_consumers | &nbsp; | instance, cluster |
| lavinmq_disk_space_available_bytes | &nbsp; | instance, cluster |
| lavinmq_process_open_fds | &nbsp; | instance, cluster |
| lavinmq_process_resident_memory_bytes | &nbsp; | instance, cluster |
| lavinmq_queues | &nbsp; | instance, cluster |
| lavinmq_queue_messages | &nbsp; | instance, cluster |
| lavinmq_queue_messages_ready | &nbsp; | instance, cluster |
| lavinmq_queue_messages_unacked | &nbsp; | instance, cluster |

### Exported RabbitMQ metrics

| Metric | Metric labels | CloudAMQP labels |
| --- | --- | --- |
| rabbitmq_global_messages_acknowledged_total | protocol, queue_type | instance, cluster |
| rabbitmq_global_messages_delivered_total | protocol, queue_type | instance, cluster |
| rabbitmq_global_messages_delivered_get_manual_ack_total | protocol, queue_type | instance, cluster |
| rabbitmq_global_messages_delivered_get_auto_ack_total | protocol, queue_type | instance, cluster |
| rabbitmq_global_messages_redelivered_total | protocol, queue_type | instance, cluster |
| rabbitmq_global_messages_confirmed_total | protocol | instance, cluster |
| rabbitmq_global_messages_unroutable_dropped_total | protocol | instance, cluster |
| rabbitmq_global_messages_unroutable_returned_total | protocol | instance, cluster |
| rabbitmq_alarms_memory_used_watermark | &nbsp; | instance, cluster |
| rabbitmq_alarms_free_disk_space_watermark | &nbsp; | instance, cluster |
| rabbitmq_connections | &nbsp; | instance, cluster |
| rabbitmq_channels | &nbsp; | instance, cluster |
| rabbitmq_consumers | &nbsp; | instance, cluster |
| rabbitmq_disk_space_available_bytes | &nbsp; | instance, cluster |
| rabbitmq_exchange_messages_published_total | &nbsp; | instance, cluster |
| rabbitmq_process_open_fds | &nbsp; | instance, cluster |
| rabbitmq_process_resident_memory_bytes | &nbsp; | instance, cluster |
| rabbitmq_queues | &nbsp; | instance, cluster |
| rabbitmq_queue_get_total | &nbsp; | instance, cluster |
| rabbitmq_queue_get_ack_total | &nbsp; | instance, cluster |
| rabbitmq_queue_messages | &nbsp; | instance, cluster |
| rabbitmq_queue_messages_acked_total | &nbsp; | instance, cluster |
| rabbitmq_queue_messages_delivered_ack_total | &nbsp; | instance, cluster |
| rabbitmq_queue_messages_persistent | &nbsp; | instance, cluster |
| rabbitmq_queue_messages_published_total | &nbsp; | instance, cluster |
| rabbitmq_queue_messages_ready | &nbsp; | instance, cluster |
| rabbitmq_queue_messages_unacked | &nbsp; | instance, cluster |
| rabbitmq_queue_head_message_timestamp | &nbsp; | instance, cluster |

### Metrics Filtering

The metrics listed above are the metrics exported by default. However, you can use the `metrics_filter` endpoint to specify exactly which metrics you want to export. See the [API documentation](https://docs.cloudamqp.com/cloudamqp_api.html#update-metrics-filter-for-a-prometheus-integration) for more details.

The complete list of available metrics that can be included in the metrics filter includes:

- All metrics available from the server’s `/metrics` endpoint (broker metrics)
- All metrics available from the server’s `/metrics/detailed` endpoint (detailed broker metrics). **Note:** Detailed metrics can be resource-intensive on servers with many objects such as connections and queues.
- Server metrics:
  - `system_cpu_utilization_ratio`
  - `system_disk_io_bytes_total`
  - `system_disk_operation_time_seconds_total`
  - `system_disk_operations_total`
  - `system_filesystem_usage_bytes`
  - `system_filesystem_utilization_ratio`
  - `system_memory_limit_bytes`
  - `system_memory_usage_bytes`
  - `system_linux_memory_available_bytes`
  - `system_network_io_bytes_total`
  - `system_paging_usage_bytes`

Histograms and summaries are selected by their family name, for example `rabbitmq_message_size_bytes` for the RabbitMQ message size histogram. The collector merges the bucket, sum and count series into that single metric, so listing the family name exports all of them. The full list of names accepted by the filter for your instance is available from the [valid_metrics](https://docs.cloudamqp.com/instance-api.html#tag/metrics/GET/integrations/metrics/valid_metrics) endpoint.

[← Back to Metrics Integrations](/docs/cloudamqp-integrations/#prometheus-metrics)
