mirror of
https://github.com/minio/minio.git
synced 2025-01-12 15:33:22 -05:00
fix metrics panic in node metrics endpoint (#18894)
This commit is contained in:
parent
b4ab8e095a
commit
29b1a29044
@ -2155,56 +2155,43 @@ func getReplicationNodeMetrics(opts MetricsGroupOpts) *MetricsGroup {
|
|||||||
qs := globalReplicationStats.getNodeQueueStatsSummary()
|
qs := globalReplicationStats.getNodeQueueStatsSummary()
|
||||||
activeWorkersCount := Metric{
|
activeWorkersCount := Metric{
|
||||||
Description: getClusterReplActiveWorkersCountMD(),
|
Description: getClusterReplActiveWorkersCountMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
avgActiveWorkersCount := Metric{
|
avgActiveWorkersCount := Metric{
|
||||||
Description: getClusterReplAvgActiveWorkersCountMD(),
|
Description: getClusterReplAvgActiveWorkersCountMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
maxActiveWorkersCount := Metric{
|
maxActiveWorkersCount := Metric{
|
||||||
Description: getClusterReplMaxActiveWorkersCountMD(),
|
Description: getClusterReplMaxActiveWorkersCountMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
currInQueueCount := Metric{
|
currInQueueCount := Metric{
|
||||||
Description: getClusterReplCurrQueuedOperationsMD(),
|
Description: getClusterReplCurrQueuedOperationsMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
currInQueueBytes := Metric{
|
currInQueueBytes := Metric{
|
||||||
Description: getClusterReplCurrQueuedBytesMD(),
|
Description: getClusterReplCurrQueuedBytesMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
currTransferRate := Metric{
|
currTransferRate := Metric{
|
||||||
Description: getClusterReplCurrentTransferRateMD(),
|
Description: getClusterReplCurrentTransferRateMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
avgQueueCount := Metric{
|
avgQueueCount := Metric{
|
||||||
Description: getClusterReplAvgQueuedOperationsMD(),
|
Description: getClusterReplAvgQueuedOperationsMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
avgQueueBytes := Metric{
|
avgQueueBytes := Metric{
|
||||||
Description: getClusterReplAvgQueuedBytesMD(),
|
Description: getClusterReplAvgQueuedBytesMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
maxQueueCount := Metric{
|
maxQueueCount := Metric{
|
||||||
Description: getClusterReplMaxQueuedOperationsMD(),
|
Description: getClusterReplMaxQueuedOperationsMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
maxQueueBytes := Metric{
|
maxQueueBytes := Metric{
|
||||||
Description: getClusterReplMaxQueuedBytesMD(),
|
Description: getClusterReplMaxQueuedBytesMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
avgTransferRate := Metric{
|
avgTransferRate := Metric{
|
||||||
Description: getClusterReplAvgTransferRateMD(),
|
Description: getClusterReplAvgTransferRateMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
maxTransferRate := Metric{
|
maxTransferRate := Metric{
|
||||||
Description: getClusterReplMaxTransferRateMD(),
|
Description: getClusterReplMaxTransferRateMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
}
|
}
|
||||||
mrfCount := Metric{
|
mrfCount := Metric{
|
||||||
Description: getClusterReplMRFFailedOperationsMD(),
|
Description: getClusterReplMRFFailedOperationsMD(),
|
||||||
VariableLabels: map[string]string{serverName: qs.NodeName},
|
|
||||||
Value: float64(qs.MRFStats.LastFailedCount),
|
Value: float64(qs.MRFStats.LastFailedCount),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2249,7 +2236,6 @@ func getReplicationNodeMetrics(opts MetricsGroupOpts) *MetricsGroup {
|
|||||||
Description: getClusterRepLinkLatencyCurrMD(),
|
Description: getClusterRepLinkLatencyCurrMD(),
|
||||||
VariableLabels: map[string]string{
|
VariableLabels: map[string]string{
|
||||||
"endpoint": ep,
|
"endpoint": ep,
|
||||||
serverName: globalLocalNodeName,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
m.Value = float64(health.latency.curr / time.Millisecond)
|
m.Value = float64(health.latency.curr / time.Millisecond)
|
||||||
@ -2260,7 +2246,6 @@ func getReplicationNodeMetrics(opts MetricsGroupOpts) *MetricsGroup {
|
|||||||
Description: getClusterRepLinkLatencyAvgMD(),
|
Description: getClusterRepLinkLatencyAvgMD(),
|
||||||
VariableLabels: map[string]string{
|
VariableLabels: map[string]string{
|
||||||
"endpoint": ep,
|
"endpoint": ep,
|
||||||
serverName: globalLocalNodeName,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
m.Value = float64(health.latency.avg / time.Millisecond)
|
m.Value = float64(health.latency.avg / time.Millisecond)
|
||||||
@ -2271,7 +2256,6 @@ func getReplicationNodeMetrics(opts MetricsGroupOpts) *MetricsGroup {
|
|||||||
Description: getClusterRepLinkLatencyMaxMD(),
|
Description: getClusterRepLinkLatencyMaxMD(),
|
||||||
VariableLabels: map[string]string{
|
VariableLabels: map[string]string{
|
||||||
"endpoint": ep,
|
"endpoint": ep,
|
||||||
serverName: globalLocalNodeName,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
m.Value = float64(health.latency.peak / time.Millisecond)
|
m.Value = float64(health.latency.peak / time.Millisecond)
|
||||||
@ -2281,7 +2265,6 @@ func getReplicationNodeMetrics(opts MetricsGroupOpts) *MetricsGroup {
|
|||||||
Description: getClusterRepLinkOnlineMD(),
|
Description: getClusterRepLinkOnlineMD(),
|
||||||
VariableLabels: map[string]string{
|
VariableLabels: map[string]string{
|
||||||
"endpoint": ep,
|
"endpoint": ep,
|
||||||
serverName: globalLocalNodeName,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
online := Offline
|
online := Offline
|
||||||
@ -2294,7 +2277,6 @@ func getReplicationNodeMetrics(opts MetricsGroupOpts) *MetricsGroup {
|
|||||||
Description: getClusterRepLinkCurrOfflineDurationMD(),
|
Description: getClusterRepLinkCurrOfflineDurationMD(),
|
||||||
VariableLabels: map[string]string{
|
VariableLabels: map[string]string{
|
||||||
"endpoint": ep,
|
"endpoint": ep,
|
||||||
serverName: globalLocalNodeName,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
currDowntime := time.Duration(0)
|
currDowntime := time.Duration(0)
|
||||||
@ -2308,7 +2290,6 @@ func getReplicationNodeMetrics(opts MetricsGroupOpts) *MetricsGroup {
|
|||||||
Description: getClusterRepLinkTotalOfflineDurationMD(),
|
Description: getClusterRepLinkTotalOfflineDurationMD(),
|
||||||
VariableLabels: map[string]string{
|
VariableLabels: map[string]string{
|
||||||
"endpoint": ep,
|
"endpoint": ep,
|
||||||
serverName: globalLocalNodeName,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
dwntime := currDowntime
|
dwntime := currDowntime
|
||||||
|
Loading…
Reference in New Issue
Block a user