@@ -169,18 +169,14 @@ func (auditor *AzureAuditor) Run() {
169
169
fmt .Sprintf (ReportResourceGraph , queryName ),
170
170
auditor .Opts .Cronjobs .ResourceGraph ,
171
171
func (ctx context.Context , logger * log.Entry ) {
172
- for _ , queryConfig := range auditor .config .ResourceGraph .Queries {
173
- queryConfig .Reset ()
174
- }
172
+ auditor .config .ResourceGraph .Queries [queryName ].Reset ()
175
173
},
176
174
func (ctx context.Context , logger * log.Entry , subscription * subscriptions.Subscription , report * AzureAuditorReport , callback chan <- func ()) {
177
175
contextLogger := log .WithField ("configQueryName" , queryName )
178
176
auditor .auditResourceGraph (ctx , contextLogger , subscription , queryName , resourceGraphConfig , report , callback )
179
177
},
180
178
func (ctx context.Context , logger * log.Entry ) {
181
- for _ , gauge := range auditor .prometheus .resourceGraph {
182
- gauge .Reset ()
183
- }
179
+ auditor .prometheus .resourceGraph [queryName ].Reset ()
184
180
},
185
181
)
186
182
}
@@ -193,18 +189,14 @@ func (auditor *AzureAuditor) Run() {
193
189
fmt .Sprintf (ReportLogAnalytics , queryName ),
194
190
auditor .Opts .Cronjobs .LogAnalytics ,
195
191
func (ctx context.Context , logger * log.Entry ) {
196
- for _ , queryConfig := range auditor .config .LogAnalytics .Queries {
197
- queryConfig .Reset ()
198
- }
192
+ auditor .config .LogAnalytics .Queries [queryName ].Reset ()
199
193
},
200
194
func (ctx context.Context , logger * log.Entry , report * AzureAuditorReport , callback chan <- func ()) {
201
195
contextLogger := log .WithField ("configQueryName" , queryName )
202
196
auditor .auditLogAnalytics (ctx , contextLogger , queryName , logAnalyticsConfig , report , callback )
203
197
},
204
198
func (ctx context.Context , logger * log.Entry ) {
205
- for _ , gauge := range auditor .prometheus .logAnalytics {
206
- gauge .Reset ()
207
- }
199
+ auditor .prometheus .logAnalytics [queryName ].Reset ()
208
200
},
209
201
)
210
202
}
0 commit comments