Added weave_ipam_unreachable_percentage metric
This commit is contained in:
1 parent
88679d66fc
commit
df688cfb53
2 files changed
+12
No files matched your search
@@ -92,6 +92,17 @@ var metrics = []metric{
|
||||
}
|
||||
ch <- intGauge(desc, count)
|
||||
}},
|
||||
{desc("weave_ipam_unreachable_percentage", "Percentage of IP addresses owned by unreachable peers."),
|
||||
func(s WeaveStatus, desc *prometheus.Desc, ch chan<- prometheus.Metric) {
|
||||
var totalUnreachable uint32
|
||||
for _, entry := range summariseIpamStats(s.IPAM) {
|
||||
if !entry.reachable {
|
||||
totalUnreachable += entry.ips
|
||||
}
|
||||
}
|
||||
percentage := float64(totalUnreachable) * 100.0 / float64(s.IPAM.RangeNumIPs)
|
||||
ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, percentage)
|
||||
}},
|
||||
{desc("weave_ipam_pending_allocates", "Number of pending allocates."),
|
||||
func(s WeaveStatus, desc *prometheus.Desc, ch chan<- prometheus.Metric) {
|
||||
if s.IPAM != nil {
|
||||
|
||||
@@ -21,6 +21,7 @@ exposed:
|
||||
* `weave_dns_entries` - Number of DNS entries.
|
||||
* `weave_flows` - Number of FastDP flows.
|
||||
* `weave_ipam_unreachable_count` - Number of unreachable peers that own IPAM addresses.
|
||||
* `weave_ipam_unreachable_percentage` - Percentage of all IP addresses owned by unreachable peers.
|
||||
* `weave_ipam_pending_allocates` - Number of pending allocates.
|
||||
* `weave_ipam_pending_claims` - Number of pending claims.
|
||||
|
||||
|
||||
Reference in new issue
Block a user