---
title: "Prometheus metrics | Grafana Cloud documentation"
description: "Send metrics data from Prometheus To get Prometheus metrics into Grafana Cloud, configure Prometheus to push scraped samples using remote_write. remote_write allows you to forward scraped samples to compatible remote storage endpoints. To learn more, refer to the Prometheus remote_write documentation."
---

# Send metrics data from Prometheus

To get Prometheus metrics into Grafana Cloud, configure Prometheus to push scraped samples using `remote_write`. `remote_write` allows you to forward scraped samples to compatible remote storage endpoints. To learn more, refer to the [Prometheus `remote_write` documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write).

> Note
> 
> Grafana Cloud Metrics doesn’t support the Prometheus [push gateway protocol](https://prometheus.io/docs/practices/pushing/). Grafana Mimir uses `remote_write` instead to receive metrics data.

## Send data from a Prometheus instance

To send Prometheus data to Grafana Cloud Metrics you will need a running Prometheus instance in your environment, as in the following diagram:

Add the following `remote_write` snippet to your Prometheus configuration file (often `prometheus.yml`). You can find the `/api/prom/push` URL, username, and password for your metrics endpoint by clicking on **Details** in the Prometheus card of the [Cloud Portal](/docs/grafana-cloud/security-and-account-management/cloud-portal/):

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
remote_write:
  - url: <Your Metrics instance remote_write endpoint>
    basic_auth:
      username: <Your Metrics instance ID>
      password: <Your Cloud Access Policy token>
```

### Send Prometheus native histograms

You can send Prometheus native histograms to Grafana Cloud. For more information, refer to [Send and query native histograms](/docs/grafana-cloud/send-data/metrics/metrics-prometheus/native-histograms/).

## Send data from multiple Prometheus instances

When sending metrics from multiple Prometheus instances, you can use the `external_labels` parameter to label time series data with an instance identifier. Append any `external_labels` to the `global` section of your Prometheus configuration file. You can find the `/api/prom/push` URL, username, and password for your metrics endpoint by clicking on **Details** in the Prometheus card of the [Cloud Portal](/docs/grafana-cloud/security-and-account-management/cloud-portal/):

First Prometheus instance:

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
global:
  external_labels:
    origin_prometheus: prometheus01
remote_write:
  - url: <Your Metrics instance remote_write endpoint>
    basic_auth:
      username: <Your Metrics instance ID>
      password: <Your Cloud Access Policy token>
```

Second Prometheus instance:

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
global:
  external_labels:
    origin_prometheus: prometheus02
remote_write:
  - url: <Your Metrics instance remote_write endpoint>
    basic_auth:
      username: <Your Metrics instance ID>
      password: <Your Cloud Access Policy token>
```

## Send data from multiple high-availability Prometheus instances

If you’re shipping data to Grafana Cloud Metrics from multiple Prometheus instances in a high-availability (HA) configuration, you should use the `cluster` and `__replica__` labels to deduplicate data received at the Grafana Cloud Metrics endpoint. Add these to the `external_labels` section in your Prometheus configuration file. You can find the `/api/prom/push` URL, username, and password for your metrics endpoint by clicking on **Details** in the Prometheus card of the [Cloud Portal](/docs/grafana-cloud/security-and-account-management/cloud-portal/):

Grafana Cloud Metrics enables HA deduplication by default. It expects the `cluster` and `__replica__` label names.

First HA Prometheus instance:

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
global:
  external_labels:
    cluster: prom-team1
    __replica__: replica1
remote_write:
  - url: <Your Metrics instance remote_write endpoint>
    basic_auth:
      username: <Your Metrics instance ID>
      password: <Your Cloud Access Policy token>
```

Second HA Prometheus instance:

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
global:
  external_labels:
    cluster: prom-team1
    __replica__: replica2
remote_write:
  - url: <Your Metrics instance remote_write endpoint>
    basic_auth:
      username: <Your Metrics instance ID>
      password: <Your Cloud Access Policy token>
```

Use the `cluster` label to identify the HA Prometheus cluster shipping data to Grafana Cloud Metrics. Set the `__replica__` label to a unique value within the HA Prometheus cluster. It drops when Grafana Cloud Metrics deduplicates and ingests the data.

If your environment uses a different replica label name (for example, `replica`), change it to `__replica__` so Grafana Cloud Metrics can deduplicate your samples.

If you can’t change the external label names in your environment, open a support ticket and ask for a backend configuration change. For details, refer to [Grafana Cloud support options](/docs/grafana-cloud/account-management/support/).

To learn more about how deduplication works, refer to [Configure Grafana Mimir high-availability deduplication](/docs/mimir/latest/configure/configure-high-availability-deduplication/) in the Grafana Mimir documentation.

To learn more about Prometheus configuration parameters, refer to the [Prometheus.io Configuration Docs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write).

The [Monitoring a Linux host using Prometheus and Node Exporter](/docs/grafana-cloud/send-data/metrics/metrics-prometheus/prometheus-config-examples/noagent_linuxnode/) provides a complete start to finish example of installing a local Prometheus instance and using `remote_write` to send metrics from the instance to Grafana Cloud.

## Scrape metrics from a Prometheus endpoint

With the Metrics Endpoint integration, you can automate the scraping of any Prometheus-compatible publicly accessible URL. The scraped metrics are then stored in Grafana Cloud, without requiring any additional infrastructure. You can set up multiple configurations, known as “scrape jobs”, to simultaneously monitor multiple URLs.

This method is recommended for serverless environments or platforms that do not provide access to the underlying infrastructure to install monitoring tools.

To learn more about this method, review the [Metrics Endpoint integration for Grafana Cloud](/docs/grafana-cloud/monitor-infrastructure/integrations/integration-reference/integration-metrics-endpoint/) guide.

## Troubleshoot issues

Refer to the following troubleshooting information, as required.

### Receive read-only or can’t open file message

These errors suggest that your user lacks the necessary write permissions to edit the `prometheus.yml` file. To resolve this issue, switch to a user with write permissions.

## Next steps

To query your metrics instance using HTTP APIs, refer to [Query metrics using HTTP APIs](/docs/grafana-cloud/send-data/metrics/metrics-prometheus/query-http-api/).
