diff --git a/cmd/metrics-v2.go b/cmd/metrics-v2.go index 15c789b3f..80ee2c271 100644 --- a/cmd/metrics-v2.go +++ b/cmd/metrics-v2.go @@ -1651,13 +1651,13 @@ func getClusterTierMetrics() *MetricsGroup { cacheInterval: 10 * time.Second, } mg.RegisterRead(func(ctx context.Context) (metrics []Metric) { - if globalTierConfigMgr.Empty() { - return - } objLayer := newObjectLayerFn() if objLayer == nil || globalIsGateway { return } + if globalTierConfigMgr.Empty() { + return + } dui, err := loadDataUsageFromBackend(GlobalContext, objLayer) if err != nil { diff --git a/cmd/tier.go b/cmd/tier.go index 824bb3025..486b1522b 100644 --- a/cmd/tier.go +++ b/cmd/tier.go @@ -148,6 +148,9 @@ func (config *TierConfigMgr) Verify(ctx context.Context, tier string) error { // Empty returns if tier targets are empty func (config *TierConfigMgr) Empty() bool { + if config == nil { + return true + } return len(config.ListTiers()) == 0 }