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

Only register grpc TLS metrics on successful handshake #1338

Merged
merged 3 commits into from
Dec 31, 2024

Conversation

mattb18
Copy link
Contributor

@mattb18 mattb18 commented Dec 23, 2024

In the current gRPC implementation, TLS metrics are registered before the handshake is complete. In cases where the probe fails, probeSSLEarliestCertExpiryGauge is set to the default time.Time value (far in the past), resulting in any alerts using probe_ssl_earliest_cert_expiry metric firing.

In the case of the TLS handshake failing, it makes more sense for TLS metrics not to be set. This is the way the http probe is currently configured:

registry.MustRegister(probeSSLEarliestCertExpiryGauge, probeTLSVersion, probeTLSCipher, probeSSLLastChainExpiryTimestampSeconds, probeSSLLastInformation)

This should also solve #1120.

@mattb18
Copy link
Contributor Author

mattb18 commented Dec 23, 2024

Seems like the gRPC tests seem to be failing on all recent merge requests? I'm not able to reproduce this failure locally.

@mattb18 mattb18 force-pushed the master branch 2 times, most recently from f589ae6 to a73f810 Compare December 23, 2024 17:08
Signed-off-by: mattb18 <[email protected]>
Copy link
Member

@electron0zero electron0zero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for your contribution 👏🏼

@electron0zero electron0zero merged commit 9cc59c3 into prometheus:master Dec 31, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants