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

Make range configurable in dashboard queries #36

Open
serathius opened this issue Jun 18, 2018 · 7 comments
Open

Make range configurable in dashboard queries #36

serathius opened this issue Jun 18, 2018 · 7 comments
Labels

Comments

@serathius
Copy link
Contributor

e. .g Dashboards like "K8s / Compute Resources / Cluster" uses query sum(irate(container_cpu_usage_seconds_total[1m])) by (namespace)
That creates hidden dependency that scrape job can't run less frequent then sub 1m.

I think range should be configurable

@tomwilkie
Copy link
Member

That creates hidden dependency that scrape job can't run less frequent then sub 1m.

Well technically, 30s - you need at least 2 data points for a rate to work reliably. And realistically, your rate range should be 4x scrape, to deal with jitter etc - hence 1m, which is 4x 15s, the default scrape period.

That creates hidden dependency that scrape job can't run less frequent then sub 1m. I think range should be configurable

Sounds good to me! Although I'd like to experiment using grafana's $__interval meta variable here, so that when you zoom out in Grafana, the rate duration also get larger: http://docs.grafana.org/reference/templating/#the-interval-variable

@ravishivt
Copy link

It would be nice to have it configurable but I'd recommend setting 2m as the default for rate queries. See kubernetes/ingress-nginx#2884 for another project that made the same.

@omerlh
Copy link
Contributor

omerlh commented Dec 24, 2019

Any update regarding this issue?

@omerlh
Copy link
Contributor

omerlh commented Dec 24, 2019

Anyone facing a simpler issue, this is a quick jsonnet fix (that also add labels for grafana config map loader):

{ 'grafana-dashboards-configmaps': 
       configMapList.new([
        configmap + configmap.mixin.metadata.withLabels({"grafana_dashboard": "1"}) 
        + configmap.withData({[item]: std.strReplace(configmap.data[item], '[1m]', '[2m]') for item in std.objectFields(configmap.data)})
        for configmap in kp.grafana.dashboardDefinitions.items
      ]) } + 

@metalmatze
Copy link
Member

I don't think there are any plans to change it.

@brancz
Copy link
Member

brancz commented Jan 9, 2020

Why not use $__interval? That should always pick a reasonable interval as it's based on screen real estate available.

Copy link

This issue has not had any activity in the past 30 days, so the
stale label has been added to it.

  • The stale label will be removed if there is new activity
  • The issue will be closed in 7 days if there is no new activity
  • Add the keepalive label to exempt this issue from the stale check action

Thank you for your contributions!

@github-actions github-actions bot added the stale label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants