From f19df84750f77958530667c79319d49ea42e6f08 Mon Sep 17 00:00:00 2001 From: rahulguptajss Date: Mon, 25 Nov 2024 16:51:59 +0530 Subject: [PATCH] fix: panic if no volumes have analytics enabled --- .../plugins/volumetopmetrics/volumetopmetrics.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/collectors/restperf/plugins/volumetopmetrics/volumetopmetrics.go b/cmd/collectors/restperf/plugins/volumetopmetrics/volumetopmetrics.go index 669fa0d97..84e0b2561 100644 --- a/cmd/collectors/restperf/plugins/volumetopmetrics/volumetopmetrics.go +++ b/cmd/collectors/restperf/plugins/volumetopmetrics/volumetopmetrics.go @@ -186,19 +186,23 @@ func (t *TopMetrics) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Matrix, * metricsData, err := t.processTopMetrics(data) if err != nil { - return nil, nil, err + return nil, t.client.Metadata, err + } + + if metricsData == nil { + return nil, t.client.Metadata, nil } if t.clientMetricsEnabled { err = t.processTopClients(metricsData) if err != nil { - return nil, nil, err + return nil, t.client.Metadata, err } } if t.fileMetricsEnabled { err = t.processTopFiles(metricsData) if err != nil { - return nil, nil, err + return nil, t.client.Metadata, err } }