-
Notifications
You must be signed in to change notification settings - Fork 146
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
Report the certificate expiration as a prometheus metric. #106
Conversation
I think this is ready, but leaving as a draft until I get confirmation that seconds-until-expiration is the proper way to report this. |
Updated this based on discussion on the issue. This should be ready to go now! I should note that I wasn't fully able to test this since I don't have a valid certificate for Sygnal. |
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.
looks generally sensible, but a couple of thoughts
Thanks @richvdh! I made some updates from your feedback. The timezone handling is a bit weird, but cryptography says:
And the
I believe I've combined these two pieces of info correctly! :) |
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.
lgtm
This reports the epoch time (in seconds) of the APNs certificate expiry as a prometheus metric. The metric is updated each time the certificate is loaded (so each time sygnal is started).
pyOpenSSL becomes a direct dependency instead of just a transient one via aioapns.
Fixes #103