-
Notifications
You must be signed in to change notification settings - Fork 21
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
register cloud events metrics. #217
Conversation
Signed-off-by: morvencao <[email protected]>
/assign @clyang82 |
# curl https://localhost:8443/metrics -k -H "Authorization: Bearer $TOKEN" | grep cloudevents
# HELP cloudevents_received_total The total number of received CloudEvents.
# TYPE cloudevents_received_total counter
cloudevents_received_total{cluster="24d810e3-b42c-44c8-a1bf-cd617259358a",source="maestro",type="io.open-cluster-management.works.v1alpha1.manifestbundles"} 4
cloudevents_received_total{cluster="24d810e3-b42c-44c8-a1bf-cd617259358a",source="maestro",type="io.open-cluster-management.works.v1alpha1.manifests"} 17
# HELP cloudevents_sent_total The total number of sent CloudEvents.
# TYPE cloudevents_sent_total counter
cloudevents_sent_total{cluster="24d810e3-b42c-44c8-a1bf-cd617259358a",source="24d810e3-b42c-44c8-a1bf-cd617259358a-work-agent",type="io.open-cluster-management.works.v1alpha1.manifestbundles"} 11
cloudevents_sent_total{cluster="24d810e3-b42c-44c8-a1bf-cd617259358a",source="24d810e3-b42c-44c8-a1bf-cd617259358a-work-agent",type="io.open-cluster-management.works.v1alpha1.manifests"} 53
# curl https://localhost:8443/metrics -k -H "Authorization: Bearer $TOKEN" | grep manifestwork
# HELP manifestworks_processed_total The total number of processed manifestworks.
# TYPE manifestworks_processed_total counter
manifestworks_processed_total{action="delete",code="Success"} 1
manifestworks_processed_total{action="list",code="Success"} 1
manifestworks_processed_total{action="patch",code="Success"} 1
manifestworks_processed_total{action="watch",code="Success"} 1
# curl https://localhost:8443/metrics -k -H "Authorization: Bearer $TOKEN" | grep client_reconnected_total
# HELP cloudevents_client_reconnected_total The total number of reconnects for the CloudEvents client.
# TYPE cloudevents_client_reconnected_total counter
cloudevents_client_reconnected_total{client_id="24d810e3-b42c-44c8-a1bf-cd617259358a-work-agent"} 1 |
@@ -42,7 +43,7 @@ func NewSourceClient(sourceOptions *ceoptions.CloudEventsSourceOptions, resource | |||
} | |||
|
|||
// register resource resync metrics for cloud event source client | |||
cegeneric.RegisterResourceResyncMetrics() | |||
cegeneric.RegisterCloudEventsMetrics(prometheus.DefaultRegisterer) |
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.
what is different between legacyregistry
and prometheus.DefaultRegisterer
?
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.
legacyregistry
is used by maestro-agent with library-go to register metrics, and prometheus.DefaultRegisterer
is typically used with the Prometheus SDK to register metrics.
Do we have e2e test for metrics? |
cf03406
to
cdef13b
Compare
@clyang82 added simple integration test as UT cover the metrics in sdk-go repo. |
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.
LGMT
/ok-to-test |
Signed-off-by: morvencao <[email protected]>
cdef13b
to
ebe06b9
Compare
/ok-to-test |
The following changes are included in the bump; - ensure spec is returned in the status change event when a maestro bundle is being deleted (openshift-online/maestro#225) - support entra auth for postgres (openshift-online/maestro#221) - fix maestro agent resync unstable (openshift-online/maestro#220) - register cloud events metrics(openshift-online/maestro#217) - avoid nil point in go-sdk (openshift-online/maestro#212) - update mqtt lib to resolve mqtt pinger problem (openshift-online/maestro#200) - support print date in log (openshift-online/maestro#195) - avoid race conditions on maestro-agent (openshift-online/maestro#196) - use orphan delete option as default option for read only update strategy (openshift-online/maestro#189)
ref: https://issues.redhat.com/browse/ACM-14351