Skip to content
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

Prometheus metric for certificate ready condition #1679

Closed
seleznev opened this issue May 15, 2019 · 4 comments · Fixed by #1811
Closed

Prometheus metric for certificate ready condition #1679

seleznev opened this issue May 15, 2019 · 4 comments · Fixed by #1811
Assignees
Labels
area/monitoring Indicates a PR or issue relates to monitoring kind/feature Categorizes issue or PR as related to a new feature. lifecycle/active priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@seleznev
Copy link
Contributor

Is your feature request related to a problem? Please describe.

cert-manager exposes only one Certificate kind related metric (certmanager_certificate_expiration_timestamp_seconds) right now and it is not enough for proper monitoring. For example, it would be great to known when new certificate hang on signing for some reason.

Describe the solution you'd like

kube-state-metrics exposes some similar metrics, for example kube_pod_status_ready. I suggest to add something like this to cert-manager.

Environment details (if applicable):

  • cert-manager v0.7.2

/kind feature

@jetstack-bot jetstack-bot added the kind/feature Categorizes issue or PR as related to a new feature. label May 15, 2019
@munnerz munnerz added the area/monitoring Indicates a PR or issue relates to monitoring label May 15, 2019
@munnerz
Copy link
Member

munnerz commented May 15, 2019

Exposing more information through metrics is definitely something we want to do.

Could you elaborate some more on the types of metrics you'd like to see, and how you'd expect us to set these metrics/the values that we use?

@munnerz munnerz added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label May 15, 2019
@seleznev
Copy link
Contributor Author

Could you elaborate some more on the types of metrics you'd like to see, and how you'd expect us to set these metrics/the values that we use?

Personally, I prefer to see metrics consistent with another Kubernetes resources metrics (exposed by kube-state-metrics). So, I suggest to add metric like this:

# HELP certmanager_certificate_status_ready Describes whether the certificate is ready to use.
# TYPE certmanager_certificate_status_ready gauge
certmanager_certificate_status_ready{condition="false",name="something",namespace="default"} 0
certmanager_certificate_status_ready{condition="true",name="something",namespace="default"} 1
certmanager_certificate_status_ready{condition="unknown",name="something",namespace="default"} 0

But any another way to let users known about certificate that has not ready=True status is ok. :)

A simple patch to illustrate: https://github.com/seleznev/cert-manager/commit/1e08ec33a625b75f3a5293f99a36583d2dc44637 (no pull request because I didn't tested it with master and we should wait #1681 to be merged anyway).

@cheukwing
Copy link
Contributor

/assign
/lifecycle active

@Hackmeat
Copy link

hi,
i have a question about this metric, right now i get all 3 conditions back from cert manager for every single certificate. Is there a way to only get the one showing the right status?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/monitoring Indicates a PR or issue relates to monitoring kind/feature Categorizes issue or PR as related to a new feature. lifecycle/active priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants