capsule icon indicating copy to clipboard operation
capsule copied to clipboard

feat: expose custom metrics for tenants status

Open gernest opened this issue 3 years ago • 2 comments

closes #451

This commit adds pkg/stats that defines prometheus counters for active and cordoned tenants.

These metrics are exposed to controller-runtime. So they are visible on the controller metrics endpoint.

This was tested manually , after creating a new tenant the metrics showed up on the metrics service endpoint

# HELP capsule_tenants_status_active_count Total number of active tenants
# TYPE capsule_tenants_status_active_count counter
capsule_tenants_status_active_count 1

gernest avatar Apr 12 '22 12:04 gernest

Deploy Preview for capsule-documentation canceled.

Name Link
Latest commit 2bc20a43c7bf395090a1efa84fa77ecd3a7786aa
Latest deploy log https://app.netlify.com/sites/capsule-documentation/deploys/6255775e397afb00087270b3

netlify[bot] avatar Apr 12 '22 12:04 netlify[bot]

@prometherion is this something we can merge in master?

bsctl avatar Jul 13 '22 21:07 bsctl

This is a good start :)
@prometherion any updates on this?

adberger avatar Jan 23 '23 14:01 adberger

what do you think about using https://github.com/kubernetes/kube-state-metrics/blob/main/docs/customresourcestate-metrics.md? It allows to add custom metrics based on fields in CRD without a need to modify code

MaxFedotov avatar Feb 03 '23 11:02 MaxFedotov

what do you think about using https://github.com/kubernetes/kube-state-metrics/blob/main/docs/customresourcestate-metrics.md? It allows to add custom metrics based on fields in CRD without a need to modify code

Solved according to your suggestion, made an example in the referenced issue (https://github.com/projectcapsule/capsule/issues/451).

adberger avatar Oct 23 '23 06:10 adberger

Closing in favour of https://github.com/projectcapsule/capsule/issues/451#issuecomment-1774537482.

prometherion avatar Oct 24 '23 08:10 prometherion