> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/tutorials/observability/monitoring-service/use-ionos-grafana-as-external-prometheus-datasource.md).

# Query Monitoring Service Metrics from Your External Grafana Instance

## Overview

This tutorial shows how to connect your external Grafana instance (such as Grafana Cloud) to the <code class="expression">space.vars.ionos\_cloud</code> Monitoring Service. It uses the internal Grafana datasource proxy as a Prometheus-compatible endpoint. No VPN or agent is required.

## Target audience

This tutorial benefits developers, DevOps engineers, and platform teams who use an external Grafana instance (such as Grafana Cloud) and want to visualize metrics from the <code class="expression">space.vars.ionos\_cloud</code> Monitoring Service alongside their existing dashboards. This tutorial assumes basic familiarity with:

* Grafana datasource configuration.
* HTTP authentication headers.
* The <code class="expression">space.vars.ionos\_cloud</code> Console.

## What you will learn

* How to create a service account token in the <code class="expression">space.vars.ionos\_cloud</code> internal Grafana.
* How to locate the Grafana Mimir datasource Unique Identifier (UID).
* How to configure a different Grafana to query <code class="expression">space.vars.ionos\_cloud</code> Monitoring Service metrics.

## Before you begin

Ensure you have:

* An active <code class="expression">space.vars.ionos\_cloud</code> account with Monitoring Service activated.
* An external Grafana instance, for example [<mark style="color:blue;">Grafana Cloud</mark>](https://grafana.com/products/cloud/).
* Access to the <code class="expression">space.vars.ionos\_cloud</code> Grafana for monitoring services at `https://grafana.logging.<region>.ionos.com`.

{% hint style="warning" %}
**Important:**

* Metrics are transmitted outside the <code class="expression">space.vars.ionos\_cloud</code> platform. When you connect your external Grafana instance, metrics are read from <code class="expression">space.vars.ionos\_cloud</code> Monitoring Service and processed by that instance. The <code class="expression">space.vars.ionos\_cloud</code> Data Processing Agreement covers processing within <code class="expression">space.vars.ionos\_cloud</code> and does not extend to your external Grafana provider. You are responsible for the agreement with that provider and for the lawfulness of the transfer.
* <code class="expression">space.vars.ionos\_cloud</code> Monitoring Service stores metrics in the region of your monitoring pipeline. Once queried, they are processed wherever your external Grafana instance runs. If data residency is a requirement, select an external Grafana region accordingly.
  {% endhint %}

{% hint style="info" %}
**Note:** Review your metric labels before exporting. Metric values are typically aggregates, but metric labels can contain personal data. For example IP addresses, user or account identifiers, e-mail addresses, or hostnames that identify individuals. Check which label sets you expose through the data source proxy and involve your data protection officer where they contain such fields.
{% endhint %}

## Cost considerations

This tutorial uses an existing <code class="expression">space.vars.ionos\_cloud</code> Monitoring Service subscription. No additional resources are created, so no extra charges apply. If you do not have Monitoring Service activated yet, see [<mark style="color:blue;">Monitoring Service User Guide</mark>](https://docs.ionos.com/cloud/observability/monitoring-service/billing) for pricing information.

{% hint style="info" %}
**Note:** Metrics and logs collection is opt-in per resource. If Monitoring Service is not activated for a specific resource, no data will appear in Grafana for that resource.
{% endhint %}

## Procedure

{% stepper %}
{% step %}

### Create a service account token in the IONOS CLOUD Grafana

1. Go to `https://grafana.logging.<region>.ionos.com/org/serviceaccounts`.
2. Click **Add service account** button, enter a name such as `metrics-reader`, and set role to **Viewer**.
3. Open the service account, click **Add token** button, click **Generate token** button.
4. Copy the token immediately. It is shown only once. Store it in a password manager.

{% hint style="warning" %}
**Important:** Create the token in the <code class="expression">space.vars.ionos\_cloud</code> **Grafana**, not your external Grafana instance.
{% endhint %}
{% endstep %}

{% step %}

### Get the Grafana Mimir datasource UID

In the <code class="expression">space.vars.ionos\_cloud</code> Grafana, go to **Connections > Data sources > Mimir**. The UID is in the browser URL:

```
.../connections/datasources/edit/<mimir-uid>
```

{% hint style="info" %}
**Note:** The Grafana Mimir datasource UID differs per region. Always look it up in the <code class="expression">space.vars.ionos\_cloud</code> Grafana instance for the region you are connecting to.
{% endhint %}
{% endstep %}

{% step %}

### Add the datasource in your external Grafana

{% hint style="info" %}
**Important:** If you are using Grafana Cloud, do not edit the provisioned `grafanacloud-*-prom` datasource. That one is locked. Add a new datasource instead.
{% endhint %}

1. In your external Grafana, go to **Connections , Data sources , Add new data source , Prometheus**.
2. Configure it with these values (You will need <code class="expression">space.vars.ionos\_cloud</code> Grafana service account and Grafana Mimir UID):

| Field                       | Value                                                                              |
| --------------------------- | ---------------------------------------------------------------------------------- |
| **Name**                    | `ionos-monitoring`                                                                 |
| **Prometheus server URL**   | `https://grafana.logging.<region>.ionos.com/api/datasources/proxy/uid/<mimir-uid>` |
| **Prometheus type**         | Mimir                                                                              |
| **Authentication method**   | No Authentication                                                                  |
| **HTTP Headers — Header 1** | Name: `Authorization` / Value: `Bearer <token>`                                    |
| **HTTP Headers — Header 2** | Name: `X-Grafana-Org-Id` / Value: `org`                                            |

3. Click **Save & test**.

A *"Successfully queried the Prometheus API"* message confirms the connection.
{% endstep %}

{% step %}

### Query your metrics

Go to **Explore**, select the `ionos-monitoring` datasource.

{% hint style="warning" %}
**Important:** Metrics collection is opt-in per resource. If you see no data, verify that Monitoring Service is activated for the resources you want to observe. Refer to the [<mark style="color:blue;">Monitoring Service User Guide</mark>](https://docs.ionos.com/cloud/observability/monitoring-service) for activation steps.
{% endhint %}
{% endstep %}
{% endstepper %}

## Troubleshooting

**Save & test returns an error**

* Check that the `Authorization` header value starts with `Bearer` (note the space).
* Verify the `<mimir-uid>` in the URL matches exactly what appears in the <code class="expression">space.vars.ionos\_cloud</code> Grafana datasource URL.
* Make sure the service account token was created in the <code class="expression">space.vars.ionos\_cloud</code> Grafana, not in your external Grafana.

**Metrics do not appear in Grafana Explore**

* Monitoring Service data collection is opt-in per resource. Verify the resources you want to monitor have Monitoring Service activated.
* Check that the datasource test passed successfully before querying.

## Decommission resources

When you no longer need the connection, delete the service account token to prevent unauthorized access:

1. Go to `https://grafana.logging.<region>.ionos.com/org/serviceaccounts`.
2. Open the service account , find the token , click **Delete token**.

You can also delete the entire service account if it is no longer needed.

## Next steps

* Set a token expiry date and add a calendar reminder to rotate it before it expires.
* Explore available metrics using the metrics browser in Grafana Explore.
* To add logs alongside metrics, use the **Loki** datasource UID from the same proxy endpoint.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/tutorials/observability/monitoring-service/use-ionos-grafana-as-external-prometheus-datasource.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
