Skip to content

Commit 084bd27

Browse files
committed
udp_queues_linux.go: Expose UDP drops via gauge analogous to queue sizes.
Signed-off-by: Chris Cleeland <[email protected]>
1 parent 5c4f9e7 commit 084bd27

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

collector/udp_queues_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func (c *udpQueuesCollector) Update(ch chan<- prometheus.Metric) error {
6262
if errIPv4 == nil {
6363
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.TxQueueLength), "tx", "v4")
6464
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.RxQueueLength), "rx", "v4")
65+
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(*s4.Drops), "drops", "v4")
6566
} else {
6667
if errors.Is(errIPv4, os.ErrNotExist) {
6768
level.Debug(c.logger).Log("msg", "not collecting ipv4 based metrics")
@@ -74,6 +75,7 @@ func (c *udpQueuesCollector) Update(ch chan<- prometheus.Metric) error {
7475
if errIPv6 == nil {
7576
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.TxQueueLength), "tx", "v6")
7677
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.RxQueueLength), "rx", "v6")
78+
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(*s6.Drops), "drops", "v6")
7779
} else {
7880
if errors.Is(errIPv6, os.ErrNotExist) {
7981
level.Debug(c.logger).Log("msg", "not collecting ipv6 based metrics")

0 commit comments

Comments
 (0)