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

OSM metrics should not be gathered when capability is disabled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 4.14
    • Monitoring
    • None
    • Moderate
    • No
    • MON Sprint 249
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      openshift-state-metrics has logic to generate metrics for builds/buildconfigs.  That logic will fail when the buildconfig (or any other collector component for that matter) capability is disabled and the api does not exist.
      
      see:
      https://github.com/openshift/openshift-state-metrics/blob/774cb2ff4b9e21c452650643528c6fa190c7885a/main.go#L65-L70
      https://github.com/openshift/openshift-state-metrics/blob/774cb2ff4b9e21c452650643528c6fa190c7885a/pkg/collectors/build_config.go#L108-L136
      https://github.com/openshift/openshift-state-metrics/blob/774cb2ff4b9e21c452650643528c6fa190c7885a/pkg/collectors/build.go#L175-L188
      
      

      Version-Release number of selected component (if applicable):

      4.14
      

      How reproducible:

      always
      

      Steps to Reproduce:

      1.  oc logs -c openshift-state-metrics openshift-state-metrics-8d8965fc7-r6kcz -n openshift-monitoring | grep build.openshift
      

      Actual results:

      errors in the openshift state metrics container logs due to non-existent api endpoint
      
      E1012 01:32:59.190721       1 reflector.go:138] github.com/openshift/openshift-state-metrics/pkg/collectors/builder.go:228: Failed to watch *v1.BuildConfig: failed to list *v1.BuildConfig: the server could not find the requested resource (get buildconfigs.build.openshift.io)
      E1012 01:33:00.591096       1 reflector.go:138] github.com/openshift/openshift-state-metrics/pkg/collectors/builder.go:228: Failed to watch *v1.Build: failed to list *v1.Build: the server could not find the requested resource (get builds.build.openshift.io)
      
      
      

      Expected results:

      no errors in the log related to the missing build, buildconfig, or DeploymentConfig APIs
      
      

      Note: this bug needs the same fix as https://issues.redhat.com/browse/OCPBUGS-20438 to make openshift state metrics aware of which caps are enabled on the cluster.

            prasriva@redhat.com Pranshu Srivastava
            rh-ee-sabiswas Sayan Biswas
            Sayan Biswas Sayan Biswas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: