# Grafana Cloud (Loki) Log Integration

CloudAMQP ships broker logs to Grafana Cloud, stored in Loki, via the **OpenTelemetry Protocol (OTLP).** Available on RabbitMQ and LavinMQ dedicated instances.

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

## 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 **Configure** on the **OpenTelemetry** tile. You will find your **OTLP endpoint** (e.g. `https://otlp-gateway-prod-<region>.grafana.net/otlp`), your numeric **instance ID,** and the option to generate an **API token.**
3. Generate an API token with at minimum the `logs:write` scope, or use a Service Account token with the `MetricsPublisher` role.
4. Enter the endpoint URL, instance ID, and API token in the CloudAMQP console and click **Save.**

## Querying your logs

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

```promql
{service_name="your-cluster-name"}
{host_name="your-cluster-name-01"}
```

## Log attributes

Each log record includes the following resource attributes:

- `service_name` — your CloudAMQP cluster name (Loki renames `service.name`)
- `host_name` — the individual node hostname (Loki renames `host.name`)
- `appname` — always `rabbitmq` or `lavinmq`
- Severity — mapped from the journald PRIORITY field to the OpenTelemetry severity spec (INFO = 9, WARN = 13, ERROR = 17)

Metrics can be shipped to the same Grafana Cloud stack with the [Grafana Cloud metrics integration](/docs/monitoring-metrics-grafana/).

[← Back to Log Integrations](/docs/cloudamqp-integrations/#otel-logs)
