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

Grafana Dashboards: displays NaN as a result for queries that runs division operation #22

Open
antonblr opened this issue Jan 5, 2024 · 0 comments

Comments

@antonblr
Copy link

antonblr commented Jan 5, 2024

Flux Cluster stats dashboard (haven't tried the other one yet) shows NaN in places where it runs queries with division operation, .e.g.

sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~"$operator_namespace",exported_namespace=~"$namespace",kind=~"Kustomization|HelmRelease"}[5m])) by (kind)
/ sum(rate(gotk_reconcile_duration_seconds_count{namespace=~"$operator_namespace",exported_namespace=~"$namespace",kind=~"Kustomization|HelmRelease"}[5m])) by (kind) 

image

image

This due to division by zero. My workaround is to add > 0 to such queries (I added it everywhere, but it can be limited to divisor only), like:

sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~"$operator_namespace",exported_namespace=~"$namespace",kind=~"Kustomization|HelmRelease"}[5m]) > 0) by (kind)
/ sum(rate(gotk_reconcile_duration_seconds_count{namespace=~"$operator_namespace",exported_namespace=~"$namespace",kind=~"Kustomization|HelmRelease"}[5m]) > 0) by (kind) 
@antonblr antonblr changed the title Grafana Dashboards: exclude NaN metrics from queries results Grafana Dashboards: displays NaN as a result for queries that runs division operation Jan 5, 2024
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

No branches or pull requests

1 participant