# Grafana Integration

Grafana is an open source platform for data visualization, monitoring, and analysis. You may integrate this software with the Monitoring as a Service for more convenient use.

1. Go to the [<mark style="color:blue;">API reference</mark>](https://api.ionos.com/docs/monitoring/v1/)
2. Install [<mark style="color:blue;">grafana</mark>](https://grafana.com/docs/grafana/latest/setup-grafana/installation/debian/)
3. Generate the first token
4. curl -uusername:password [<mark style="color:blue;">https://api.ionos.com/auth/v1/tokens/generate</mark>](https://api.ionos.com/auth/v1/tokens/generate) or -n if you use [<mark style="color:blue;">netrc</mark>](https://everything.curl.dev/usingcurl/netrc.html)
5. It is also possible to query the metrics using curl:

`curl -H "Authorization: Bearer ${TOKEN}" https://api.ionos.com/telemetry/api/v1/query?query=instance\_cpu\_utilization\_average`

## Add data source to Grafana <a href="#maasapigrafana-adddatasourcetografana" id="maasapigrafana-adddatasourcetografana"></a>

* Login to Grafana
* Configuration (on the left side)
* Data source

![Integration icon](/files/NEuumUMzzfYXDdV8jhTm)

## Data source

**HTTP**

* **URL:** `https://api.ionos.com/telemetry/`

{% hint style="warning" %}
**Configuration requirements:** Ensure that you update the URL with the required query string parameters and include a valid `Authorization` header. The Telemetry API is modeled after the Prometheus Query API. For more information, refer to the [<mark style="color:blue;">Prometheus Documentation</mark>](https://prometheus.io/docs/prometheus/latest/querying/api/).
{% endhint %}

**Custom HTTP Headers**

* **Authorization Value:** `Bearer eyJ0eXAiOiJK`
* **HTTP Methods:** `GET` and `POST`
* Save and test
* Go to Explore (on the left side)
* Choose the new Data source
* In the **Metrics Browser,** write instance
* Choose one of the metrics
* Run query

![Integration icon](/files/GfNl54xyMJM3EyPBD8gZ)

You can query on these metrics now:

**series whitelist**:

`- instance_cpu_utilization_average`

`- instance_network_in_packets`

`- instance_network_out_bytes`

`- instance_network_in_bytes`

`- instance_network_out_packets`

`- instance_volumes_read_bytes`

`- instance_volumes_write_bytes`

`- instance_volumes_read_ops`

`- instance_volumes_write_ops`


---

# Agent Instructions: 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:

```
GET https://docs.ionos.com/cloud/observability/monitoring-as-a-service/api-how-tos/grafana-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
