New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose metrics for the rhmi installation CR #784
Conversation
4599bc5
to
aaa2bc0
Compare
/test images |
77aaaf7
to
33e7b2f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fantastic @jjaferson . Reviewed code and verified on cluster. One requested change on the addition to the CSV. this should be changed in deploy/role.yaml
.
rhmi_status - Looks Good
rhmi_status_available - Looks Good
rhmi_info - Question
One question on the rhmi_info metric. You can see from the screenshot there are two metrics being exposed for this. Do you know why this is?
...lm-catalog/integreatly-operator/2.2.0/integreatly-operator.v2.2.0.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
I noticed that but I think it's something that happens by default as I saw the same metric for other CRDs like |
It looks like the metric is being scraped from 2 different places/endpoints. |
I was doing some investigation and I found out that there is a gauge metric being exposed on port 8686 of the operator
https://github.com/integr8ly/integreatly-operator/blob/master/cmd/manager/main.go#L148 Not sure where the metric is created |
Metric is created by default by the operator-sdk Custom resource specific metrics By default operator will expose info metrics based on the number of the current instances of an operator’s custom resources in the cluster. It leverages kube-state-metrics as a library to generate those metrics. Metrics initialization lives in the cmd/manager/main.go file of the operator in the serveCRMetrics function. Its arguments are a custom resource’s group, version, and kind to generate the metrics. The metrics are served on 0.0.0.0:8686/metrics by default. https://sdk.operatorframework.io/docs/golang/monitoring/prometheus/ |
Looks like a CR metric exposed by the operator sdk for any/all CRD instances that exist. I think we need to change the name of the metric that we're in control of (not the sdk generated one) |
Yup, what about |
03eebaf
to
85c5830
Compare
/test e2e failed to create e2e pod
|
/retest |
1 similar comment
/retest |
/lgtm @jjaferson Great work. Please make sure to update the JIRA with the name change from rhmi_info to rhmi_spec |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidffrench The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test test-cases-lint |
Approved changes now, dismissing requested changes
Unable to tag @openshift/openshift-team-monitoring, |
Description
Exposes two metrics for the RHMI installation CR
rhmi_status and rhmi_info
https://issues.redhat.com/browse/INTLY-6667
Verification steps
curl 0.0.0.0:8383/metrics | grep rhmi_status{
curl 0.0.0.0:8383/metrics | grep rhmi_info{
Type of change
Checklist