From 07ca8e67f89bdf2240eb17f6f0be71508af7f689 Mon Sep 17 00:00:00 2001 From: Preslav Gerchev Date: Sat, 21 Oct 2023 11:34:23 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20azure=20advisor=20score=20?= =?UTF-8?q?resource.=20(#2316)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/azure/resources/advisor.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/providers/azure/resources/advisor.go b/providers/azure/resources/advisor.go index 9df3a5cced..83e866c18c 100644 --- a/providers/azure/resources/advisor.go +++ b/providers/azure/resources/advisor.go @@ -113,10 +113,12 @@ func (a *mqlAzureSubscriptionAdvisorService) scores() ([]interface{}, error) { } id := fmt.Sprintf("%s/timeSeries/%d/scores/%d", s.ID, tsIdx, idx) mqlTsScore, err := CreateResource(a.MqlRuntime, "azure.subscription.advisorService.securityScore", map[string]*llx.RawData{ - "id": llx.StringData(id), - "date": llx.TimeData(dt), - "score": llx.FloatData(sh.Score), - "consumptionUnits": llx.FloatData(sh.ConsumptionUnits), + "id": llx.StringData(id), + "date": llx.TimeData(dt), + "score": llx.FloatData(sh.Score), + "consumptionUnits": llx.FloatData(sh.ConsumptionUnits), + // time series do not have a category count + "categoryCount": llx.NilData, "impactedResourcesCount": llx.IntData(int64(sh.ImpactedResourceCount)), "potentialScoreIncrease": llx.FloatData(sh.PotentialScoreIncrease), }) @@ -145,6 +147,7 @@ func (a *mqlAzureSubscriptionAdvisorService) scores() ([]interface{}, error) { "date": llx.TimeData(dt), "score": llx.FloatData(s.Properties.LastRefreshedScore.Score), "consumptionUnits": llx.FloatData(s.Properties.LastRefreshedScore.ConsumptionUnits), + "categoryCount": llx.IntData(int64(s.Properties.LastRefreshedScore.CategoryCount)), "impactedResourcesCount": llx.IntData(int64(s.Properties.LastRefreshedScore.ImpactedResourceCount)), "potentialScoreIncrease": llx.FloatData(s.Properties.LastRefreshedScore.PotentialScoreIncrease), })