internal/arpndp: rename the ARP/NDP stats group to "arpndp".
@@ -3,54 +3,54 @@ package arp
import "github.com/prometheus/client_golang/prometheus"
var stats = metrics{
- arpIn: prometheus.NewCounterVec(prometheus.CounterOpts{
+ in: prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "metallb",
- Subsystem: "arp",
+ Subsystem: "arpndp",
Name: "requests_received",
- Help: "Number of ARP requests received for owned IPs",
+ Help: "Number of ARP/NDP requests received for owned IPs",
}, []string{
"ip",
}),
- arpOut: prometheus.NewCounterVec(prometheus.CounterOpts{
+ out: prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "metallb",
- Subsystem: "arp",
+ Subsystem: "arpndp",
Name: "responses_sent",
- Help: "Number of ARP responses sent for owned IPs in response to requests",
+ Help: "Number of ARP/NDP responses sent for owned IPs in response to requests",
}, []string{
"ip",
}),
- arpGratuitous: prometheus.NewCounterVec(prometheus.CounterOpts{
+ gratuitous: prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "metallb",
- Subsystem: "arp",
+ Subsystem: "arpndp",
Name: "gratuitous_sent",
- Help: "Number of gratuitous ARP packets sent for owned IPs as a result of failovers",
+ Help: "Number of gratuitous ARP/NDP packets sent for owned IPs as a result of failovers",
}, []string{
"ip",
}),
}
type metrics struct {
- arpIn *prometheus.CounterVec
- arpOut *prometheus.CounterVec
- arpGratuitous *prometheus.CounterVec
+ in *prometheus.CounterVec
+ out *prometheus.CounterVec
+ gratuitous *prometheus.CounterVec
}
func init() {
- prometheus.MustRegister(stats.arpIn)
- prometheus.MustRegister(stats.arpOut)
- prometheus.MustRegister(stats.arpGratuitous)
+ prometheus.MustRegister(stats.in)
+ prometheus.MustRegister(stats.out)
+ prometheus.MustRegister(stats.gratuitous)
}
func (m *metrics) GotRequest(addr string) {
- m.arpIn.WithLabelValues(addr).Add(1)
+ m.in.WithLabelValues(addr).Add(1)
}
func (m *metrics) SentResponse(addr string) {
- m.arpOut.WithLabelValues(addr).Add(1)
+ m.out.WithLabelValues(addr).Add(1)
}
func (m *metrics) SentGratuitous(addr string) {
- m.arpGratuitous.WithLabelValues(addr).Add(1)
+ m.gratuitous.WithLabelValues(addr).Add(1)
}
