mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-08-20 18:33:52 -07:00
udp_queues_linux.go: Expose UDP drops via gauge analogous to queue sizes.
Signed-off-by: Chris Cleeland <chris.cleeland@gmail.com>
This commit is contained in:
parent
8f9a914bee
commit
392f9accd6
|
@ -61,6 +61,7 @@ func (c *udpQueuesCollector) Update(ch chan<- prometheus.Metric) error {
|
||||||
if errIPv4 == nil {
|
if errIPv4 == nil {
|
||||||
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.TxQueueLength), "tx", "v4")
|
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.TxQueueLength), "tx", "v4")
|
||||||
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.RxQueueLength), "rx", "v4")
|
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.RxQueueLength), "rx", "v4")
|
||||||
|
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(*s4.Drops), "drops", "v4")
|
||||||
} else {
|
} else {
|
||||||
if errors.Is(errIPv4, os.ErrNotExist) {
|
if errors.Is(errIPv4, os.ErrNotExist) {
|
||||||
c.logger.Debug("not collecting ipv4 based metrics")
|
c.logger.Debug("not collecting ipv4 based metrics")
|
||||||
|
@ -73,6 +74,7 @@ func (c *udpQueuesCollector) Update(ch chan<- prometheus.Metric) error {
|
||||||
if errIPv6 == nil {
|
if errIPv6 == nil {
|
||||||
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.TxQueueLength), "tx", "v6")
|
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.TxQueueLength), "tx", "v6")
|
||||||
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.RxQueueLength), "rx", "v6")
|
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.RxQueueLength), "rx", "v6")
|
||||||
|
ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(*s6.Drops), "drops", "v6")
|
||||||
} else {
|
} else {
|
||||||
if errors.Is(errIPv6, os.ErrNotExist) {
|
if errors.Is(errIPv6, os.ErrNotExist) {
|
||||||
c.logger.Debug("not collecting ipv6 based metrics")
|
c.logger.Debug("not collecting ipv6 based metrics")
|
||||||
|
|
Loading…
Reference in a new issue