mirror of https://github.com/minio/minio.git
metrics: Avoid crash when fetching tier metrics (#14493)
Data usage does not always contain tiering info even if the data usage information is valid. Avoid a crash in that case. (e.g. the scanner scanned the namespace, the user enables tiering, prometheus scrapes the server before the scanner gets a chance to update the data usage with new tiering information)
This commit is contained in:
parent
1d1b213f1f
commit
bacf6156c1
|
@ -1663,8 +1663,8 @@ func getClusterTierMetrics() *MetricsGroup {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
// data usage has not captured any data yet.
|
||||
if dui.LastUpdate.IsZero() {
|
||||
// data usage has not captured any tier stats yet.
|
||||
if dui.TierStats == nil {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue