This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pool_metrics.go
54 lines (42 loc) · 2.18 KB
/
pool_metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package caboose
import "github.com/prometheus/client_golang/prometheus"
// pool metrics
var (
poolRemovedFailureTotalMetric = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_removed_failure_total"),
}, []string{"tier", "reason"})
poolRemovedConnFailureTotalMetric = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_removed_conn_failure_total"),
}, []string{"tier"})
poolRemovedReadFailureTotalMetric = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_removed_read_failure_total"),
}, []string{"tier"})
poolRemovedNon2xxTotalMetric = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_removed_non2xx_total"),
}, []string{"tier"})
// The below metrics are only updated periodically on every Caboose pool refresh
poolMembersNotAddedBecauseRemovedMetric = prometheus.NewGauge(prometheus.GaugeOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_members_not_added"),
})
poolMembersRemovedAndAddedBackMetric = prometheus.NewGauge(prometheus.GaugeOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_removed_and_added_back"),
})
poolRefreshErrorMetric = prometheus.NewCounter(prometheus.CounterOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_refresh_errors"),
Help: "Number of errors refreshing the caboose pool",
})
poolSizeMetric = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_size"),
Help: "Number of active caboose peers",
}, []string{"tier"})
poolNewMembersMetric = prometheus.NewGauge(prometheus.GaugeOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_new_members"),
Help: "New members added to the Caboose pool",
})
poolEnoughObservationsForMainSetDurationMetric = prometheus.NewGauge(prometheus.GaugeOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_observations_for_main_set_duration"),
})
poolTierChangeMetric = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: prometheus.BuildFQName("ipfs", "caboose", "pool_tier_change"),
}, []string{"change"})
)