mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Add process metrics in metrics-v3 (#19612)
endpoint: /minio/metrics/v3/system/process metrics: - locks_read_total - locks_write_total - cpu_total_seconds - go_routine_total - io_rchar_bytes - io_read_bytes - io_wchar_bytes - io_write_bytes - start_time_seconds - uptime_seconds - file_descriptor_limit_total - file_descriptor_open_total - syscall_read_total - syscall_write_total - resident_memory_bytes - virtual_memory_bytes - virtual_memory_max_bytes Since the standard process collector implements only a subset of these metrics, remove it and implement our own custom process collector that captures all the process metrics we need.
This commit is contained in:
@@ -144,6 +144,29 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection {
|
||||
loadCPUMetrics,
|
||||
)
|
||||
|
||||
systemProcessMG := NewMetricsGroup(systemProcessCollectorPath,
|
||||
[]MetricDescriptor{
|
||||
processLocksReadTotalMD,
|
||||
processLocksWriteTotalMD,
|
||||
processCPUTotalSecondsMD,
|
||||
processGoRoutineTotalMD,
|
||||
processIORCharBytesMD,
|
||||
processIOReadBytesMD,
|
||||
processIOWCharBytesMD,
|
||||
processIOWriteBytesMD,
|
||||
processStarttimeSecondsMD,
|
||||
processUptimeSecondsMD,
|
||||
processFileDescriptorLimitTotalMD,
|
||||
processFileDescriptorOpenTotalMD,
|
||||
processSyscallReadTotalMD,
|
||||
processSyscallWriteTotalMD,
|
||||
processResidentMemoryBytesMD,
|
||||
processVirtualMemoryBytesMD,
|
||||
processVirtualMemoryMaxBytesMD,
|
||||
},
|
||||
loadProcessMetrics,
|
||||
)
|
||||
|
||||
systemDriveMG := NewMetricsGroup(systemDriveCollectorPath,
|
||||
[]MetricDescriptor{
|
||||
driveUsedBytesMD,
|
||||
@@ -263,6 +286,7 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection {
|
||||
systemDriveMG,
|
||||
systemMemoryMG,
|
||||
systemCPUMG,
|
||||
systemProcessMG,
|
||||
|
||||
clusterHealthMG,
|
||||
clusterUsageObjectsMG,
|
||||
@@ -299,13 +323,10 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection {
|
||||
}
|
||||
|
||||
// Prepare to register the collectors. Other than `MetricGroup` collectors,
|
||||
// we also have standard collectors like `ProcessCollector` and `GoCollector`.
|
||||
// we also have standard collectors like `GoCollector`.
|
||||
|
||||
// Create all Non-`MetricGroup` collectors here.
|
||||
collectors := map[collectorPath]prometheus.Collector{
|
||||
systemProcessCollectorPath: collectors.NewProcessCollector(collectors.ProcessCollectorOpts{
|
||||
ReportErrors: true,
|
||||
}),
|
||||
systemGoCollectorPath: collectors.NewGoCollector(),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user