Skip to content

Commit

Permalink
🐛 Fix azure advisor score resource. (#2316)
Browse files Browse the repository at this point in the history
  • Loading branch information
preslavgerchev authored Oct 21, 2023
1 parent 5e2cfe4 commit 07ca8e6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions providers/azure/resources/advisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
Expand Down Expand Up @@ -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),
})
Expand Down

0 comments on commit 07ca8e6

Please sign in to comment.