-
Bug
-
Resolution: Done
-
Undefined
-
None
-
4.17.0
-
None
-
Low
-
None
-
False
-
Description of problem:
In https://github.com/ComplianceAsCode/compliance-operator/blob/master/doc/usage.md#metrics, there is a command to get metrics for compliance operator doesn't work. % oc run --rm -i --restart=Never --image=registry.fedoraproject.org/fedora-minimal:latest -n openshift-compliance metrics-test -- bash -c 'curl -ks -H "Authorization: Bea rer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" https://metrics.openshift-compliance.svc:8585/metrics-co' 400 Bad Requestpod "metrics-test" deleted The metrics itself works: % oc exec -n openshift-monitoring -c prometheus prometheus-k8s-0 -- curl -k -H "Authorization: Bearer $(oc create token prometheus-k8s -n openshift-monitoring)" https://metrics.openshift-compliance.svc:8585/metrics-co | grep compliance | head % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:decrement:-- --:decrement:-- --:decrement:-- 0# HELP compliance_operator_compliance_remediation_status_total A counter for the total number of updates to the status of a ComplianceRemediation # TYPE compliance_operator_compliance_remediation_status_total counter compliance_operator_compliance_remediation_status_total{name="ocp4-stig-audit-profile-set",state="NotApplied"} 2 compliance_operator_compliance_remediation_status_total{name="ocp4-stig-audit-profile-set",state="Pending"} 1 compliance_operator_compliance_remediation_status_total{name="ocp4-stig-oauth-or-oauthclient-token-maxage",state="NotApplied"} 2 compliance_operator_compliance_remediation_status_total{name="ocp4-stig-oauth-or-oauthclient-token-maxage",state="Pending"} 1 compliance_operator_compliance_remediation_status_total{name="ocp4-stig-project-config-and-template-network-policy",state="NotApplied"} 2 compliance_operator_compliance_remediation_status_total{name="ocp4-stig-project-config-and-template-network-policy",state="Pending"} 1 compliance_operator_compliance_remediation_status_total{name="ocp4-stig-project-config-and-template-network-policy-1",state="NotApplied"} 2 compliance_operator_compliance_remediation_status_total{name="ocp4-stig-project-config-and-template-network-policy-1",state="Pending"} 1
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
1. Install Compliance Operator 2. Create a ssb 3. Try to run command `% oc run --rm -i --restart=Never --image=registry.fedoraproject.org/fedora-minimal:latest -n openshift-compliance metrics-test -- bash -c 'curl -ks -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" https://metrics.openshift-compliance.svc:8585/metrics-co' `
Actual results:
With the command in the upstream doc, I cannot get the metrics info.
Expected results:
The upstream doc https://github.com/ComplianceAsCode/compliance-operator/blob/master/doc/usage.md#metrics should offer the right command to get metrics.
Additional info:
- links to
- mentioned on