openshift-online / maestro

Maestro Service Repo
Apache License 2.0
11 stars 20 forks source link

register cloud events metrics. #217

Closed morvencao closed 2 weeks ago

morvencao commented 2 weeks ago

ref: https://issues.redhat.com/browse/ACM-14351

morvencao commented 2 weeks ago

/assign @clyang82

morvencao commented 2 weeks ago
# 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
clyang82 commented 2 weeks ago

Do we have e2e test for metrics?

morvencao commented 2 weeks ago

@clyang82 added simple integration test as UT cover the metrics in sdk-go repo.

clyang82 commented 2 weeks ago

/ok-to-test

clyang82 commented 2 weeks ago

/ok-to-test