capsule
capsule copied to clipboard
feat: expose custom metrics for tenants status
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
Deploy Preview for capsule-documentation canceled.
| Name | Link |
|---|---|
| Latest commit | 2bc20a43c7bf395090a1efa84fa77ecd3a7786aa |
| Latest deploy log | https://app.netlify.com/sites/capsule-documentation/deploys/6255775e397afb00087270b3 |
@prometherion is this something we can merge in master?
This is a good start :)
@prometherion any updates on this?
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
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).
Closing in favour of https://github.com/projectcapsule/capsule/issues/451#issuecomment-1774537482.