Skip to content

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

@antonblr

Description

@antonblr

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) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions