Add process uptime metric (#11844)

This commit is contained in:
Ritesh H Shukla
2021-03-20 21:23:27 -07:00
committed by GitHub
parent 7b3719c17b
commit 23b03dadb8
2 changed files with 64 additions and 51 deletions

View File

@@ -110,6 +110,7 @@ const (
lastActivityTime = "last_activity_nano_seconds"
startTime = "starttime_seconds"
upTime = "uptime_seconds"
)
const (
@@ -724,7 +725,16 @@ func getMinIOProcessStartTimeMD() MetricDescription {
Namespace: nodeMetricNamespace,
Subsystem: processSubsystem,
Name: startTime,
Help: "Start time for MinIO process per node in seconds.",
Help: "Start time for MinIO process per node, time in seconds since Unix epoc.",
Type: gaugeMetric,
}
}
func getMinIOProcessUptimeMD() MetricDescription {
return MetricDescription{
Namespace: nodeMetricNamespace,
Subsystem: processSubsystem,
Name: upTime,
Help: "Uptime for MinIO process per node in seconds.",
Type: gaugeMetric,
}
}
@@ -812,6 +822,11 @@ func getMinioProcMetrics() MetricsGroup {
Description: getMinIOProcessStartTimeMD(),
Value: startTime,
})
metrics = append(metrics,
Metric{
Description: getMinIOProcessUptimeMD(),
Value: time.Since(globalBootTime).Seconds(),
})
return
},
}