From ef32d524a5705c2636dc8d62d40b6f98d14c2669 Mon Sep 17 00:00:00 2001 From: Mitali Salvi Date: Thu, 30 May 2024 15:22:56 -0400 Subject: [PATCH] Adding additional check for null --- .../awscontainerinsightreceiver/internal/stores/podstore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/awscontainerinsightreceiver/internal/stores/podstore.go b/receiver/awscontainerinsightreceiver/internal/stores/podstore.go index 5127f4955f41..18af28cdfcf5 100644 --- a/receiver/awscontainerinsightreceiver/internal/stores/podstore.go +++ b/receiver/awscontainerinsightreceiver/internal/stores/podstore.go @@ -371,7 +371,7 @@ func (p *PodStore) decorateNode(metric CIMetric) { metric.AddField(ci.MetricName(ci.TypeNode, ci.RunningPodCount), nodeStats.podCnt) metric.AddField(ci.MetricName(ci.TypeNode, ci.RunningContainerCount), nodeStats.containerCnt) - if p.includeEnhancedMetrics { + if p.includeEnhancedMetrics && p.nodeInfo.provider != nil { if nodeStatusCapacityPods, ok := p.nodeInfo.getNodeStatusCapacityPods(); ok { metric.AddField(ci.MetricName(ci.TypeNode, ci.StatusCapacityPods), nodeStatusCapacityPods) }