Grafana needs to know scrape_interval for $__rate_interval #546
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Closes: #543
Solution
Grafana assumes the scrape interval as 15s by default but COS stack assumes 1m. Without telling Grafana that COS Prometheus uses 1m as the global scrape interval, many graphs will break since $__rate_interval won't be calculated properly.
Context
Hardcoding 1m itself is in question, but this patch fixes many graphs using $__rate_interval without touching the fundamental pieces.
ref:
https://grafana.com/docs/grafana/latest/datasources/prometheus/configure-prometheus-data-source/#interval-behavior https://grafana.com/blog/2020/09/28/new-in-grafana-7.2-__rate_interval-for-prometheus-rate-queries-that-just-work/ #544
Testing Instructions
Deploy the COS stack and grafana-agent machine charm and relate those. Open the node-exporter dashboard in Grafana and zoom into 15 min and confirm the graphs are shown instead of "no data".
Also, double check the scrape interval is set as 1m in the data source configuration.
Release Notes