2022-11-01 23:22:06 +08:00
---
aliases:
2022-12-10 00:36:04 +08:00
- ../data-sources/prometheus/
- ../features/datasources/prometheus/
2022-11-01 23:22:06 +08:00
description: Guide for using Prometheus in Grafana
keywords:
- grafana
- prometheus
- guide
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 16:10:12 +08:00
labels:
products:
- cloud
- enterprise
- oss
2022-11-01 23:22:06 +08:00
menuTitle: Prometheus
title: Prometheus data source
weight: 1300
2024-05-28 22:17:49 +08:00
refs:
build-dashboards:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /dashboards/build-dashboards/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /dashboards/build-dashboards/
get-started-prometheus:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /getting-started/get-started-grafana-prometheus/#get-started-with-grafana-and-prometheus
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /getting-started/get-started-grafana-prometheus/#get-started-with-grafana-and-prometheus
provisioning-data-sources:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /administration/provisioning/#data-sources
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /administration/provisioning/#data-sources
set-up-grafana-monitoring:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /setup-grafana/set-up-grafana-monitoring/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /setup-grafana/set-up-grafana-monitoring/
configure-grafana:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /setup-grafana/configure-grafana/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /setup-grafana/configure-grafana/
administration-documentation:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /administration/data-source-management/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /administration/data-source-management/
annotate-visualizations:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /dashboards/build-dashboards/annotate-visualizations/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/annotate-visualizations/
exemplars:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /fundamentals/exemplars/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /fundamentals/exemplars/
intro-to-prometheus:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /fundamentals/intro-to-prometheus/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /fundamentals/intro-to-prometheus/
configure-prometheus-data-source:
- pattern: /docs/grafana/
2025-05-06 22:02:52 +08:00
destination: /docs/grafana/< GRAFANA_VERSION > /datasources/prometheus/configure
- pattern: /docs/grafana-cloud/
destination: /docs/grafana/< GRAFANA_VERSION > /datasources/prometheus/configure
annotate-visualizations:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /dashboards/build-dashboards/annotate-visualizations/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/annotate-visualizations/
recorded-queries:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /administration/recorded-queries/
2024-05-28 22:17:49 +08:00
- pattern: /docs/grafana-cloud/
2025-05-06 22:02:52 +08:00
destination: /docs/grafana/< GRAFANA_VERSION > /administration/recorded-queries/
transformations:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/query-transform-data/transform-data/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/transform-data/
alerting:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /alerting/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/alerting-and-irm/alerting/
visualizations:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/
variables:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /dashboards/variables/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/dashboards/variables/
2022-11-01 23:22:06 +08:00
---
# Prometheus data source
2025-05-06 22:02:52 +08:00
Prometheus is an open source database that uses a telemetry collector agent to scrape and store metrics used for monitoring and alerting.
Grafana provides native support for Prometheus, so you don't need to install a plugin.
The following documentation will help you get started working with Prometheus and Grafana:
2023-06-28 22:27:40 +08:00
2025-05-06 22:02:52 +08:00
- [What is Prometheus? ](ref:intro-to-prometheus )
- [Prometheus data model ](https://prometheus.io/docs/concepts/data_model/ )
- [Getting started ](https://prometheus.io/docs/prometheus/latest/getting_started/ )
- [Configure the Prometheus data source ](ref:configure-prometheus-data-source )
- [Prometheus query editor ](query-editor/ )
- [Template variables ](template-variables/ )
2022-11-01 23:22:06 +08:00
2025-05-06 22:02:52 +08:00
## Exemplars
2025-03-15 04:57:01 +08:00
2025-05-06 22:02:52 +08:00
In Prometheus, an **exemplar** is a specific trace that represents a measurement taken within a given time interval. While metrics provide an aggregated view of your system, and traces offer a detailed view of individual requests, exemplars serve as a bridge between the two, linking high-level metrics to specific traces for deeper insights.
2025-03-15 04:57:01 +08:00
2025-05-06 22:02:52 +08:00
Exemplars associate higher-cardinality metadata from a specific event with traditional time series data. Refer to [Introduction to exemplars ](ref:exemplars ) in the Prometheus documentation for detailed information on how they work.
2022-11-01 23:22:06 +08:00
2025-05-06 22:02:52 +08:00
Grafana can show exemplar data alongside a metric both in Explore and in Dashboards.
2023-06-28 22:27:40 +08:00
2025-05-06 22:02:52 +08:00
{{< figure src = "/static/img/docs/v74/exemplars.png" class = "docs-image--no-shadow" caption = "Exemplar window" > }}
2023-06-28 22:27:40 +08:00
2025-05-06 22:02:52 +08:00
You add exemplars when you configure the Prometheus data source.
{{< figure src = "/static/img/docs/prometheus/exemplars-10-1.png" max-width = "500px" class = "docs-image--no-shadow" > }}
2022-11-01 23:22:06 +08:00
## Prometheus API
The Prometheus data source also works with other projects that implement the [Prometheus querying API ](https://prometheus.io/docs/prometheus/latest/querying/api/ ).
2025-05-06 22:02:52 +08:00
For more information on how to query other Prometheus-compatible projects from Grafana, refer to the specific product's documentation:
2022-11-01 23:22:06 +08:00
- [Grafana Mimir ](/docs/mimir/latest/ )
- [Thanos ](https://thanos.io/tip/components/query.md/ )
## View Grafana metrics with Prometheus
2025-05-06 22:02:52 +08:00
Grafana exposes metrics for Prometheus on the `/metrics` endpoint and includes a pre-built dashboard to help you start visualizing your metrics immediately.
2022-11-01 23:22:06 +08:00
2025-05-06 22:02:52 +08:00
Complete the following steps to import the pre-built dashboard:
2022-11-01 23:22:06 +08:00
2025-05-06 22:02:52 +08:00
1. Navigate to the Prometheus [configuration page ](ref:configure-prometheus-data-source ).
1. Click the **Dashboards** tab.
1. Locate the **Grafana metrics** dashboard in the list and click **Import** .
2022-11-01 23:22:06 +08:00
2024-05-28 22:17:49 +08:00
For details about these metrics, refer to [Internal Grafana metrics ](ref:set-up-grafana-monitoring ).
2022-11-01 23:22:06 +08:00
2023-06-28 22:27:40 +08:00
## Amazon Managed Service for Prometheus
2022-11-01 23:22:06 +08:00
2025-05-06 22:02:52 +08:00
Grafana has deprecated the Prometheus data source for Amazon Managed Service for Prometheus. Use the [Amazon Managed Service for Prometheus data source ](https://grafana.com/grafana/plugins/grafana-amazonprometheus-datasource/ ) instead. The linked documentation outlines the migration steps.
2023-04-13 02:10:10 +08:00
2025-05-06 22:02:52 +08:00
## Get the most out of the Prometheus data source
2023-06-29 23:58:22 +08:00
2025-05-06 22:02:52 +08:00
After you install and configure Prometheus you can:
2023-06-29 23:58:22 +08:00
2025-05-06 22:02:52 +08:00
- Create a wide variety of [visualizations ](ref:visualizations )
- Configure and use [templates and variables ](ref:variables )
- Add [transformations ](ref:transformations )
- Add [annotations ](ref:annotate-visualizations )
- Set up [alerting ](ref:alerting )
- Create [recorded queries ](ref:recorded-queries )