Reading and visualizing metrics with Grafana
Written by
Updated at May 14, 2024
Yandex Managed Service for Prometheus® supports the Prometheus data source
Connecting a data source
- In the management console
, select the folder where data is stored. - Create a service account with the
monitoring.viewer
role for the selected folder. - Create an API key for the service account.
- Open the homepage of your Grafana installation.
- In the main menu, select Configuration → Data Sources.
- Click Add data source.
- Under Time series databases, select Prometheus.
- In the Name field, enter the data source name.
- In the URL field, the HTTP section, specify the previously obtained endpoint.
- Under Custom HTTP headers, click Add Header and add a header for authorization. In the Header field, enter
Authorization
; in the Value field, enterBearer <API_key>
. - Click Save & test. You should see a message saying
The data source is working
.
Error examples
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. | 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 quota exceeded. | execution: too many requests: monb1piptmdo******** |
400 |
Too many lines returned from the request. Try refining your request. | bad_data: Too many metrics are loaded by selectors {job=='grafana'}, expected not more than: 10000 |
Current limitations
The Prometheus HTTP API
/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
andend
parameters are not supported and are ignored for/api/v1/labels
,/api/v1/<label_name>/values
, and/api/v1/series
requests. - The maximum number of selectors that you can provide as the
match[]
parameter is 8. - The maximum number of time series that you can get metadata for using
/api/v1/series
requests is 10,000. - The maximum number of time series that can be read per
/api/v1/query
or/api/v1/query_range
is 10,000. - The
--query.lookback-delta
parameter value is5m
.
© 2024 Linux Foundation. All rights reserved. The Linux Foundation owns and uses registered trademarks. For a list of Linux Foundation trademarks, see Trademark Usage