Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-prometheus-stack] Add interval field for default dashboards #5405

Merged
merged 6 commits into from
Mar 6, 2025

Conversation

ecd0011
Copy link
Contributor

@ecd0011 ecd0011 commented Mar 6, 2025

What this PR does / why we need it

This PR adds support for configuring the interval value used in Grafana dashboards through a new Helm value grafana.defaultDashboardsInterval.

Many Grafana dashboards in the chart have hardcoded "interval": "1m" values, which limits the resolution of metrics displayed regardless of your Prometheus scrape interval. If you're using a lower scrape interval (like 10s or 30s), you're missing out on higher resolution data that's already being collected.

This allows you to configure by making the interval configurable via Helm values, similar to how dashboard editability is already handled using the sync_grafana_dashboards.py script.

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

@QuentinBisson
Copy link
Member

Looks quite good to me

QuentinBisson
QuentinBisson previously approved these changes Mar 6, 2025
QuentinBisson
QuentinBisson previously approved these changes Mar 6, 2025
@QuentinBisson
Copy link
Member

Can you please fix the linting?

@jkroepke
Copy link
Member

jkroepke commented Mar 6, 2025

hyper theoretically, Using $__rate_interval would be a better option? A better default value?

https://grafana.com/docs/grafana/latest/datasources/prometheus/template-variables/#use-__rate_interval

@QuentinBisson
Copy link
Member

@ecd0011 would you be able to do the same for the $__rate_interval?

@QuentinBisson QuentinBisson merged commit 720e7ec into prometheus-community:main Mar 6, 2025
5 checks passed
@ecd0011
Copy link
Contributor Author

ecd0011 commented Mar 6, 2025

@jkroepke It seems like they're serving different purposes.

interval in terms of this PR is adjusting how often the queries themselves are ran. $__rate_interval is only supported for Prometheus data sources and is meant to be used in the rate function for queries: https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#__rate_interval

In other words, interval is determining when the query is executed, but not what the query retrieves. $__rate_interval helps determine what the query retrieves, but not how often it's executed.

@QuentinBisson given the documentation @jkroepke sent recommends to use the $__rate_interval for certain query functions, I'd suggest leaving it using that variable and letting Prometheus determine what the value of that should be.

@jkroepke
Copy link
Member

jkroepke commented Mar 6, 2025

thanks for clarifications! Absolute right. I thought the PR is doing something like

rate(prometheus_values[{{ $.Values.grafana.defaultDashboardsInterval}}])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants