Add check runtime metric

This commit is contained in:
Ian Fijolek
2021-05-11 10:41:22 -07:00
parent 30c2c7d6b2
commit befea7375f
3 changed files with 29 additions and 8 deletions
+2 -2
View File
@@ -74,7 +74,7 @@ func checkMonitors(config *Config) error {
// Track status metrics
Metrics.SetMonitorStatus(monitor.Name, monitor.IsUp())
Metrics.CountCheck(monitor.Name, success, hasAlert)
Metrics.CountCheck(monitor.Name, success, monitor.LastCheckMilliseconds(), hasAlert)
if alertNotice != nil {
return sendAlerts(config, monitor, alertNotice)
@@ -108,7 +108,7 @@ func main() {
// Serve metrics exporter, if specified
if ExportMetrics {
slog.Infof("Exporting metrics to Prometheus")
slog.Infof("Exporting metrics to Prometheus on port %d", MetricsPort)
go ServeMetrics()
}