Fix initial lifetime update

This commit is contained in:
2025-06-03 22:52:55 +02:00
parent 4b7ab8cd0f
commit 040a73e891
3 changed files with 7 additions and 3 deletions

View File

@@ -68,6 +68,8 @@ func (sm *StepMonitor) Start() {
stepCertError.WithLabelValues(sm.RootID).Set(1)
} else {
stepCertError.WithLabelValues(sm.RootID).Set(0)
lifetime := sm.certificate.NotAfter.Sub(sm.certificate.NotBefore).Seconds()
stepCertLifetime.WithLabelValues(sm.RootID).Set(lifetime)
}
secondsLeft := time.Until(sm.certificate.NotAfter).Seconds()
stepCertTimeLeft.WithLabelValues(sm.RootID).Set(secondsLeft)