[Yandex Cloud documentation](../../../../index.md) > [Monium](../../../index.md) > [Yandex Managed Service for Prometheus®](../index.md) > [Reading metrics](index.md) > Grafana

# Reading and visualizing metrics with Grafana

Yandex Managed Service for Prometheus® supports the [Prometheus data source](https://grafana.com/docs/grafana/latest/datasources/prometheus/) and enables you to work with dashboards you or your community created in Grafana.

The recommended visualization types are charts and dashboards in [Monium.Metrics](monitoring.md).

To transfer dashboards from existing Grafana installations, use the [import script](https://github.com/yandex-cloud-examples/yc-monitoring-dashboard-importer). It automates the workflow and prevents errors when transferring configurations manually.

## Connecting a data source {#data-source}

1. In the [management console](https://console.yandex.cloud), go to the folder that stores your data.
1. [Create a service account](../../../../iam/operations/sa/create.md) with the `monitoring.viewer` role for the selected folder.
1. [Create an API key](../../../../iam/operations/authentication/manage-api-keys.md#create-api-key) for the service account.
1. Open your Grafana homepage.
1. In the main menu, select **Configuration → Data Sources**.
1. Click **Add data source**.
1. Under **Time series databases**, select **Prometheus**.
1. In the **Name** field, enter the data source name. 
1. In the **URL** field under **HTTP**, specify the [previously obtained endpoint](../index.md#access).
1. Under **Custom HTTP headers**, click **Add Header** and add an authorization header. In the **Header** field, enter `Authorization` and in the **Value** field, `Bearer <API_key>`.
1. Click **Save & test**. You should see a message saying `The data source is working`.

## Error examples {#errors}

| Error code | Description | Error message |
|----|----|----|
| `404` | Endpoint not found. Make sure the configuration specifies the correct `url`. | ```not_found: workspace not found: monb1piptmdo********``` |
| `401` | Service account not found. Make sure the configuration specifies the correct [API key](../../../../iam/concepts/authorization/api-key.md). | ```auth: cannot authenticate by either token or api-key, cause: UNAUTHENTICATED: The token is invalid``` |
| `403` | No read permissions. Make sure the service account has the `monitoring.viewer` role for the selected folder. | ```auth: PERMISSION_DENIED: Permission denied```|
| `429` | [Number of HTTP API read requests per second](../index.md#limits) quota exceeded | ```execution: too many requests: monb1piptmdo********``` |
| `400` | Too many lines returned in the response. Try refining your query. | ```bad_data: Too many metrics are loaded by selectors {job=='grafana'}, expected not more than: 20000``` |

## Current limitations {#restrictions}

Yandex Managed Service for Prometheus® works on TCP port 443. Its public IP address is 158.160.59.216. This address may change over time. To avoid losing access to the service, we recommend using additional addresses [from the list of available ones](../../../../overview/concepts/public-ips.md).

The Prometheus [HTTP API](https://prometheus.io/docs/prometheus/latest/querying/api/) only supports the following endpoints:

* `/api/v1/query`
* `/api/v1/query_range`
* `/api/v1/labels`
* `/api/v1/<label_name>/values`
* `/api/v1/series`

The following limitations apply:
* The `timeout` parameter is not supported and is ignored.
* The `start` and `end` parameters are not supported and are ignored for the `/api/v1/labels`, `/api/v1/<label_name>/values`, and `/api/v1/series` requests.
* The maximum number of selectors you can provide in the `match[]` parameter is 8.

* The maximum number of time series you can get metadata for using the `/api/v1/series` query is 10,000.
* The maximum number of time series you can read per one `/api/v1/query` or `/api/v1/query_range` query is 10,000.

* `--query.lookback-delta` is set to `5m`.

_© 2025 Linux Foundation. All rights reserved. The Linux Foundation owns and uses registered trademarks. For a list of Linux Foundation trademarks, see [Trademark Usage](https://www.linuxfoundation.org/legal/trademark-usage)._