Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2810 from ocadotechnology/add-pending-metrics
Browse files Browse the repository at this point in the history
Add prometheus metrics for pending Allocates and Claims
  • Loading branch information
brb authored Feb 24, 2017
2 parents f7ce16c + fad537c commit 7a3e8e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions prog/weaver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ var metrics = []metric{
ch <- intGauge(desc, metrics.Flows)
}
}},
{desc("weave_ipam_pending_allocates", "Number of pending allocates."),
func(s WeaveStatus, desc *prometheus.Desc, ch chan<- prometheus.Metric) {
if s.IPAM != nil {
ch <- intGauge(desc, len(s.IPAM.PendingAllocates))
}
}},
{desc("weave_ipam_pending_claims", "Number of pending claims."),
func(s WeaveStatus, desc *prometheus.Desc, ch chan<- prometheus.Metric) {
if s.IPAM != nil {
ch <- intGauge(desc, len(s.IPAM.PendingClaims))
}
}},
}

func fastDPMetrics(s WeaveStatus) *weave.FastDPMetrics {
Expand Down
2 changes: 2 additions & 0 deletions site/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ exposed:
* `weave_max_ips` - Size of IP address space used by allocator.
* `weave_dns_entries` - Number of DNS entries.
* `weave_flows` - Number of FastDP flows.
* `weave_ipam_pending_allocates` - Number of pending allocates.
* `weave_ipam_pending_claims` - Number of pending claims.

#### Publish Router Metrics Endpoint

Expand Down

0 comments on commit 7a3e8e6

Please sign in to comment.