Skip to content

Commit

Permalink
Interface Queues: Add forwarding_class label (#250)
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Geiselhardt-Herms <ogh@deepl.com>
  • Loading branch information
taktv6 and Oliver Geiselhardt-Herms authored Jul 26, 2024
1 parent fc11b9e commit 52dffa4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/features/interfacequeue/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (c *interfaceQueueCollector) init() {
l := []string{"target", "name", "description"}
l = append(l, c.labels.LabelNames()...)
l = append(l, "queue_number")
l = append(l, "forwarding_class")

c.queuedPackets = prometheus.NewDesc(prefix+"queued_packets_count", "Number of queued packets", l, nil)
c.queuedBytes = prometheus.NewDesc(prefix+"queued_bytes_count", "Number of bytes of queued packets", l, nil)
Expand Down Expand Up @@ -125,6 +126,7 @@ func (c *interfaceQueueCollector) collectForInterface(iface physicalInterface, d

func (c *interfaceQueueCollector) collectForQueue(queue queue, ch chan<- prometheus.Metric, labelValues []string) {
l := append(labelValues, queue.Number)
l = append(l, queue.ForwaringClassName)

ch <- prometheus.MustNewConstMetric(c.queuedPackets, prometheus.CounterValue, float64(queue.QueuedPackets), l...)
ch <- prometheus.MustNewConstMetric(c.queuedBytes, prometheus.CounterValue, float64(queue.QueuedBytes), l...)
Expand Down
1 change: 1 addition & 0 deletions pkg/features/interfacequeue/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type physicalInterface struct {

type queue struct {
Number string `xml:"queue-number"`
ForwaringClassName string `xml:"forwarding-class-name"`
QueuedPackets uint64 `xml:"queue-counters-queued-packets"`
QueuedBytes uint64 `xml:"queue-counters-queued-bytes"`
TransferedPackets uint64 `xml:"queue-counters-trans-packets"`
Expand Down

0 comments on commit 52dffa4

Please sign in to comment.