-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add secret_name to prometheus metrics #7042
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Gabriel Bassinello <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @1mamute. Thanks for your PR. I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
Thanks @1mamute
The changes look good, but please explain and give working examples of how you intend to use these extra labels.
You say:
This information could be useful for many cases
Please give some examples.
You say this closes #7040, where the reported problem is:
I want to build a Grafana dashboard using the Prometheus data source to list all ingresses that aren't managed by cert-manager.
But I don't see how these new labels can be used to solve that problem.
Show me the solution in the form of a prometheus query / grafana dashboard using the new labels in this PR.
Thanks.
/ok-to-test |
The issue #7040 was made by me and I decided to open the PR because I saw it was a minor change.
We have a scenario where we issue certificates for Ingress TLS termination with an external CA and an internal private CA. I want to create a Grafana table with our external certificates' expiration dates so we have a unified place to visualize them and create alerts. I queried Then, I wanted to filter out the cert-manager's certificates, since they don't need monitoring and I queried Now, I could use the CRD name to filter out the results of
If the kube_ingress_tls
- on(secret_name) group_left()
certmanager_certificate_expiration_timestamp_seconds I think this is more reliable than comparing to the Certificate's CRD name since the secret_name on the ingress would be the same on the cert-manager Certificate CRD. Sorry, I couldn't think of any other examples besides this scenario I'm in. Also, the secret_name is a required field in the Certificate CRD. Maybe other people could find it useful to have this information. I guess the only issue would be the additional data sent to Prometheus. |
Pull Request Motivation
This PR adds the secret name of the Certificate CRD in the following prometheus metrics:
This information could be useful for many cases and closes #7040.
Kind
/kind feature
Release Note