Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-1351

health_statuses_insights metrics is showing disabled rules in "total"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • 4.12.z
    • 4.12.0
    • Insights Operator
    • None
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      health_statuses_insights metrics is showing disabled rules in "total". In other fields, it shows the correct amount.
      In the code linked below, we can see that the "Disabled" rules are only skipped during the value assigning of TotalRisk

      https://github.com/openshift/insights-operator/blob/master/pkg/insights/insightsreport/insightsreport.go#L268

      How reproducible:

      Always

      Steps to Reproduce:

      1. Upload a fake archive to trigger health checks (for example with rule CVE_2020_8555_kubernetes)
      2. Disable one of the rules through https://console.redhat.com/api/insights-results-aggregator/v1/clusters/{cluster.id}/rules/{rule}/error_key/{error_key}/disable
      3. Create support secret and set endpoint="https://httpstat.us/200"
      4. restart insights operator
      5. wait for alerts to trigger
      6. Check health_statuses_insights metrics. 

      rule:

      ccx_rules_ocp.external.rules.ocp_version_end_of_life.report

      error_key:

      OCP4X_BEYOND_EOL

       

      Actual results:

      "moderate" health_statuses_insights shows 2 triggers
      "total" shows 3. Therefore, it is accounting for the deactivated rule.

      Expected results:

      "moderate" health_statuses_insights shows 2 triggers
      "total" health_statuses_insights shows 2 triggers (doesn't account for deactivated rule)

      Additional info:

      If there is any issue in triggering this events, you may contact me and I can help with the steps.

       

            tremes1@redhat.com Tomas Remes
            jfula@redhat.com Joao Bastos Fula
            Joao Bastos Fula Joao Bastos Fula
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: