identity: add workload certificate expiry metric - #1889
Open
jlojosnegros wants to merge 1 commit into
Open
Conversation
Adds istio_cert_expiry_seconds, a Gauge that tracks the Unix timestamp at which each workload certificate expires, labeled by identity (SPIFFE URI). The metric is set in the Worker when a certificate fetch succeeds and removed when the identity is forgotten, avoiding stale series for deleted workloads. Signed-off-by: Jose Luis Ojosnegros Manchón <jojosneg@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ztunnel has no Prometheus metric for workload certificate expiration. Operators
cannot alert on certificates approaching expiry or detect silent renewal failures.
The sidecar equivalent (
istio_agent_cert_expiry_seconds) exists but has nocounterpart in Ambient Mesh.
Add
istio_cert_expiry_seconds, aGaugelabeled byidentity(SPIFFE URI),set to the Unix timestamp when the workload certificate expires. The metric is
set in
Workerwhen a certificate fetch succeeds and removed when the identityis forgotten, avoiding stale series for deleted workloads.
The value is an absolute Unix timestamp rather than seconds-remaining so it stays
correct across Prometheus scrapes without requiring a renewal cycle to refresh it.
Operators compute time-to-expiry in PromQL:
src/identity/metrics.rsMetricsstruct with the expiry gaugesrc/identity.rspub mod metricssrc/identity/manager.rsWorker; set on fetch, remove on forgetsrc/app.rsREADME.mdSolves: #1748