-
Notifications
You must be signed in to change notification settings - Fork 167
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
Tenant Metrics #451
Comments
@oliverbaehler thanks for submitting this request. Implementing them is pretty easy and straightforward. Would you like to submit a PR too? |
@bsctl Yes I will try |
@oliverbaehler any progress on this issue? Do you need for help? |
In consultation with @oliverbaehler I would like to take on this topic. However, the implementation does not seem as easy as written by @bsctl . How are metrics implemented in general by capsule and how to add custom metrics? |
@prometherion Any idea where to get started? |
Hey @adberger, thanks for the ping here! Since Capsule is built on top of I started working on this a few days ago, just pushed on branch Let's take the example of summarizing the total overall count of cordoned and active Tenants: I would expect a metric named However, since you're really active on this topic, would be great to have feedback from you regarding the structure of these metrics: would be bad to have metrics such as To me, honestly, having two time series is pretty odd, since Prometheus labels are solving this kind of problem. |
Thank you very much. |
@prometherion I might be doing something wrong but I don't see the metrics yet. I did https://capsule.clastix.io/docs/contributing/development/#fork-build-and-deploy-capsule with a kind cluster Regarding your question: Having two metrics (capsule_tenants_active_count & capsule_tenants_cordoned_count) seems fine for me. You just need different PromQL queries, but the result stays the same. |
Are you referring to the custom or basic ones? Becuase for the latters:
|
I meant the custom ones |
closes projectcapsule#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 ``` capsule_tenants_status_active_count 1 ```
closes projectcapsule#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 ``` capsule_tenants_status_active_count 1 ```
closes projectcapsule#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 ``` capsule_tenants_status_active_count 1 ```
Solved with https://github.com/kubernetes/kube-state-metrics/blob/main/docs/customresourcestate-metrics.md Example with kube-prometheus-stack Helm Chart (https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack):
|
This is definitely gold, thanks for sharing @adberger: could we transform this issue from a code-based feature to a documentation one? Looking forward to reviewing a PR from you! |
@prometherion Sorry, I currently don't have any intention to make a contribution to the documentation of capsule because I'm quite busy at the moment. |
Describe the feature
We would like to have more metrics being exported about the current tenant controlled by an operator. Some Metrics t hat would be helpful:
These are the most important ones i could think of. Another interesting feature (which most other metric exporter are lacking) ist the possibility to add labels to my resource which then are added as metric label. So le't's say I want to be able to show all tenants of certain customer. I would add the label
metrics.clastix.io/customer=a
to a tenant cr and then the labelcustomer
with the valuea
would show up in the metric. This way everyone has much greater flexibility to organize metrics, even if they come from the same controller. Simply if you would check if there's any label matchingmetrics.clastix.io/*
and then register it with the actual metric.What would the new user story look like?
Doesn't change.
Expected behavior
A clear and concise description of what you expect to happen.
The text was updated successfully, but these errors were encountered: