Changing your metrics scrape interval
Your scrape_interval
configuration is important because it determines the number of data points per minute (DPM) scraped in your active series. Depending on how you ship metrics to Grafana Cloud, you can reduce your total DPM by adjusting the scrape_interval
setting in the Grafana Agent configuration file (agent.yaml
) or your Prometheus configuration.
Note: Grafana Cloud Pro provides 1 DPM (scrape interval of 60s) resolution at a cost of 8$ per 1000 active series of additional usage. If you ship metrics at a DPM of 4 (scrape interval of 15s), your cost will be
$8 * 4 = $32
per 1000 active series of additional usage. You can learn more about DPM and pricing in Active Series and DPM.
Grafana Agent
If Grafana Agent was deployed to your infrastructure prior to October 15, 2021, the scrape_interval
setting is likely set to 10-15 seconds (4-6 DPM). New installations of the Grafana Agent will default to a 60s scrape interval (1 DPM).
Prometheus
The default scrape interval for Prometheus is 60s (1 DPM). But the scrape_interval
present in the example config file which is bundled with the Prometheus download is set to 15s (4 DPM), so you may find you are already scraping at a higher frequency than the default.
Both platforms
As a general best practice, we recommend setting the global scrape_interval
to 60s (DPM per series of 1). You may increase or decrease this setting depending on your production needs.
You can also set a job-specific scrape_interval
which defaults to the global setting. Use this override to increase the frequency per job when a higher level of granularity is needed.
If you are not sure what your scrape_interval
is set to, use the query below in Explore to find the number of times each target was scraped over the last minute. For example, a value of 1 indicates a scrape interval of 1 minute, and a 4 would indicate every 15 seconds. These values (for example 1 and 4) also represent your current DPM per series.
sort_desc(count_over_time(scrape_samples_scraped[1m]))
To increase your scrape_interval
, open up your Agent/Prometheus configuration file and change scrape_interval
to 60s
. You can learn more about configuration options as follows:
- Agent: global_config
- Prometheus: scrape_config
Next steps
If you are still uncertain and want to share your config files with our engineers for review, please create a support ticket from the Grafana Cloud portal. Be sure to remove any API keys or sensitive credentials.
To learn more about controlling your Prometheus metrics usage, please see Control Prometheus metrics usage.