Skip to content

Commit fd47335

Browse files
Merge pull request #1 from celian-garcia/feature/azuremonitorreceiver/use-batch-api-merge-and-revert-fix
fix: nil dereference when we get metrics from a resource that has not been collected properly
2 parents 04af34a + 96472f5 commit fd47335

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

receiver/azuremonitorreceiver/scraper_batch.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ func (s *azureBatchScraper) getBatchMetricsValues(ctx context.Context, subscript
457457
if timeseriesElement.Data != nil {
458458
if metricValues.ResourceID != nil {
459459
res := s.resources[*subscription.SubscriptionID][*metricValues.ResourceID]
460+
if res == nil {
461+
continue
462+
}
460463
attributes := map[string]*string{}
461464
for name, value := range res.attributes {
462465
attributes[name] = value

0 commit comments

Comments
 (0)