From 47715cbefe57248b62fb0791f07666234ad951e2 Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Fri, 25 Oct 2024 11:41:19 +0200 Subject: [PATCH] fix missing call to extractMetricUsage from Grafana dashboard Signed-off-by: Augustin Husson --- source/grafana/grafana.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/grafana/grafana.go b/source/grafana/grafana.go index 08d6982..372020b 100644 --- a/source/grafana/grafana.go +++ b/source/grafana/grafana.go @@ -66,11 +66,12 @@ func (c *grafanaCollector) Execute(ctx context.Context, _ context.CancelFunc) er metricUsage := make(map[string]*modelAPIV1.MetricUsage) for _, h := range hits { - _, getErr := c.getDashboard(h.UID) + dashboard, getErr := c.getDashboard(h.UID) if getErr != nil { logrus.WithError(getErr).Errorf("failed to get dashboard %q with UID %q", h.Title, h.UID) continue } + c.extractMetricUsage(metricUsage, dashboard) } if len(metricUsage) > 0 { c.db.EnqueueUsage(metricUsage)