We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e6b222 commit bc50e79Copy full SHA for bc50e79
src/core/metrics/metrics_util.go
@@ -18,6 +18,8 @@ import (
18
"github.com/nginx/agent/v2/src/core/config"
19
20
"github.com/gogo/protobuf/types"
21
+
22
+ log "github.com/sirupsen/logrus"
23
)
24
25
type Collector interface {
@@ -402,6 +404,11 @@ func GenerateMetricsReportBundle(entities []*StatsEntityWrapper) core.Payload {
402
404
reportMap := make(map[proto.MetricsReport_Type]*proto.MetricsReport, 0)
403
405
406
for _, entity := range entities {
407
+ if entity == nil || entity.Data == nil {
408
+ log.Debugf("Skipping nil entity in metrics generation")
409
+ continue
410
+ }
411
412
if _, ok := reportMap[entity.Type]; !ok {
413
reportMap[entity.Type] = &proto.MetricsReport{
414
Meta: &proto.Metadata{
0 commit comments