Details

    • Bug
    • Status: Done
    • Critical
    • Resolution: Fixed
    • None
    • 2.32.0
    • None
    • 0.5
    • Yes
    • Yes
    • No
    • Server Features
    • Hide

      -

      Show
      -

    Description

      User impact:

      Currently some of our embedded alerting templates are broken and never fire an alert. For example: https://github.com/percona/pmm/blob/main/managed/data/iatemplates/mysql_down.yml

      Problem affects this kind of queries:

      sum by (service_name, node_name) (mysql_up) == 0

      == 0  here works like a filter, so if mysql_up returns 1 this query in total will return nothing, but once mysql_up  return 0  whole query will return 0. And here is the problem, grafana triggers alert only on non-zero numeric data.

       

      Solutions is dead simple, we need just to add bool after comparison operator.

      sum by (service_name, node_name) (mysql_up) == bool 0

      Steps to reproduce:

       

      Actual result:

       

      Expected result:

       

      Workaround:

       

      Details:

      https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators

      Attachments

        Issue Links

          Activity

            People

              artem.gavrilov Artem Gavrilov
              artem.gavrilov Artem Gavrilov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist