telemetry: add log message when certs are about to expire
This commit is contained in:
parent
13aa7b70d5
commit
210a850353
|
@ -140,6 +140,12 @@ func (m CertExpirationMonitor) Monitor(ctx context.Context) error {
|
||||||
logger.Warn("failed to emit certificate expiry metric", "error", err)
|
logger.Warn("failed to emit certificate expiry metric", "error", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if d < 24*time.Hour {
|
||||||
|
logger.Warn("certificate will expire soon",
|
||||||
|
"time_to_expiry", d, "expiration", time.Now().Add(d))
|
||||||
|
}
|
||||||
|
|
||||||
expiry := d / time.Second
|
expiry := d / time.Second
|
||||||
metrics.SetGaugeWithLabels(m.Key, float32(expiry), m.Labels)
|
metrics.SetGaugeWithLabels(m.Key, float32(expiry), m.Labels)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue