@@ -61,7 +61,9 @@ func (c *udpQueuesCollector) Update(ch chan<- prometheus.Metric) error {
61
61
if errIPv4 == nil {
62
62
ch <- prometheus .MustNewConstMetric (c .desc , prometheus .GaugeValue , float64 (s4 .TxQueueLength ), "tx" , "v4" )
63
63
ch <- prometheus .MustNewConstMetric (c .desc , prometheus .GaugeValue , float64 (s4 .RxQueueLength ), "rx" , "v4" )
64
- ch <- prometheus .MustNewConstMetric (c .desc , prometheus .GaugeValue , float64 (* s4 .Drops ), "drops" , "v4" )
64
+ if s4 .Drops != nil {
65
+ ch <- prometheus .MustNewConstMetric (c .desc , prometheus .GaugeValue , float64 (* s4 .Drops ), "drops" , "v4" )
66
+ }
65
67
} else {
66
68
if errors .Is (errIPv4 , os .ErrNotExist ) {
67
69
c .logger .Debug ("not collecting ipv4 based metrics" )
@@ -74,7 +76,9 @@ func (c *udpQueuesCollector) Update(ch chan<- prometheus.Metric) error {
74
76
if errIPv6 == nil {
75
77
ch <- prometheus .MustNewConstMetric (c .desc , prometheus .GaugeValue , float64 (s6 .TxQueueLength ), "tx" , "v6" )
76
78
ch <- prometheus .MustNewConstMetric (c .desc , prometheus .GaugeValue , float64 (s6 .RxQueueLength ), "rx" , "v6" )
77
- ch <- prometheus .MustNewConstMetric (c .desc , prometheus .GaugeValue , float64 (* s6 .Drops ), "drops" , "v6" )
79
+ if s6 .Drops != nil {
80
+ ch <- prometheus .MustNewConstMetric (c .desc , prometheus .GaugeValue , float64 (* s6 .Drops ), "drops" , "v6" )
81
+ }
78
82
} else {
79
83
if errors .Is (errIPv6 , os .ErrNotExist ) {
80
84
c .logger .Debug ("not collecting ipv6 based metrics" )
0 commit comments