Skip to content

Commit 30df1b0

Browse files
chore: use counter prometeus (backport #735) (#741)
<hr>This is an automatic backport of pull request #735 done by [Mergify](https://mergify.com). Co-authored-by: Lazar <[email protected]>
1 parent 38048c9 commit 30df1b0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4545
* [#730](https://github.com/babylonlabs-io/finality-provider/pull/730) chore: bump babylon to `v4.0.0-rc.3`
4646
* [#732](https://github.com/babylonlabs-io/finality-provider/pull/732) feat: add version metric
4747
* [#734](https://github.com/babylonlabs-io/finality-provider/pull/734) chore: rm unused cfg val
48+
* [#735](https://github.com/babylonlabs-io/finality-provider/pull/735) chore: use counter prometeus
4849

4950
## v2.0.0-rc.5
5051

metrics/fp_collectors.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ type FpMetrics struct {
2828
fpLastProcessedHeight *prometheus.GaugeVec
2929
fpLastCommittedRandomnessHeight *prometheus.GaugeVec
3030
fpTotalBlocksWithoutVotingPower *prometheus.CounterVec
31-
fpTotalVotedBlocks *prometheus.GaugeVec
32-
fpTotalCommittedRandomness *prometheus.GaugeVec
31+
fpTotalVotedBlocks *prometheus.CounterVec
32+
fpTotalCommittedRandomness *prometheus.CounterVec
3333
fpTotalFailedVotes *prometheus.CounterVec
3434
fpTotalFailedRandomness *prometheus.CounterVec
3535
// time keeper
@@ -110,15 +110,15 @@ func NewFpMetrics() *FpMetrics {
110110
},
111111
[]string{"fp_btc_pk_hex"},
112112
),
113-
fpTotalVotedBlocks: prometheus.NewGaugeVec(
114-
prometheus.GaugeOpts{
113+
fpTotalVotedBlocks: prometheus.NewCounterVec(
114+
prometheus.CounterOpts{
115115
Name: "fp_total_voted_blocks",
116116
Help: "The total number of blocks voted by a finality provider.",
117117
},
118118
[]string{"fp_btc_pk_hex"},
119119
),
120-
fpTotalCommittedRandomness: prometheus.NewGaugeVec(
121-
prometheus.GaugeOpts{
120+
fpTotalCommittedRandomness: prometheus.NewCounterVec(
121+
prometheus.CounterOpts{
122122
Name: "fp_total_committed_randomness",
123123
Help: "The total number of randomness commitments by a finality provider.",
124124
},

0 commit comments

Comments
 (0)