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

Could not get metrics for Security Profiles Operator from GUI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • None
    • 4.12
    • None
    • Important
    • 2
    • CMP Sprint 56
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None

    Description

      Description of problem:

      Could not get metrics for Security Profiles Operator from GUI.

      $ oc get service metrics
      NAME      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
      metrics   ClusterIP   172.30.168.124   <none>        443/TCP   116m
      

       

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

      Security-profiles-operator-bundle-container-0.5.0-31 +4.12.0-0.nightly-2022-11-23-055211 

      How reproducible:

      Always

      Steps to Reproduce:

      1. Install SPO
      2. Trigger seccompprofile recording
      3. Check metrics on GUI for SPO

      Actual results:

      It prompted "No datapoints found" with below query:security_profiles_operator_seccomp_profile_total{operation="update"}
      Per servicemonitor details, the port should be https.
      $ oc -n openshift-security-profiles exec security-profiles-operator-57d5895784-9s9nr -- curl -k https://10.129.2.16:9443/metrics-spo
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to 10.129.2.16 port 9443: Connection refused
      command terminated with exit code 7
      

       

      Expected results:

      The metrics for the query should be displayed correctly

      Additional info:

      $ oc run --rm -i --restart=Never --image=registry.fedoraproject.org/fedora-minimal:latest -n openshift-security-profiles metrics-test -- bash -c     'curl -ks -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" https://metrics.openshift-security-profiles/metrics-spod' | grep security_profiles_operator | head
      # HELP security_profiles_operator_seccomp_profile_total Counter about seccomp profile operations.
      # TYPE security_profiles_operator_seccomp_profile_total counter
      security_profiles_operator_seccomp_profile_total{operation="update"} 9
      $ oc -n openshift-security-profiles exec security-profiles-operator-57d5895784-9s9nr -- curl -k http://10.129.2.16:8080/metrics | head -n 2
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100  6174    0  6174    0     0  6029k      0 --:--:-- --:--:-- --:--:-- 6029k
      # HELP certwatcher_read_certificate_errors_total Total number of certificate read errors
      # TYPE certwatcher_read_certificate_errors_total counter
      $ oc -n openshift-security-profiles exec security-profiles-operator-57d5895784-9s9nr -- curl -k http://10.129.2.16:8080/metrics | grep security_profiles_operator
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100  6174    0  6174    0     0  6029k      0 --:--:-- --:--:-- --:--:-- 6029k
      

      Attachments

        Activity

          People

            jhrozek@redhat.com Jakub Hrozek
            xiyuan@redhat.com Xiaojie Yuan
            Xiaojie Yuan Xiaojie Yuan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: