Skip to content

Commit 9712344

Browse files
committed
Add pre commit metrics to prometheus
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 175a85d commit 9712344

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

stacks-signer/src/monitoring/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ pub mod actions {
9191
BLOCK_PROPOSALS_RECEIVED.inc();
9292
}
9393

94+
/// Increment the block pre-commit sent counter
95+
pub fn increment_block_pre_commits_sent() {
96+
BLOCK_PRE_COMMITS_SENT.inc();
97+
}
98+
9499
/// Update the stx balance of the signer
95100
pub fn update_signer_stx_balance(balance: i64) {
96101
SIGNER_STX_BALANCE.set(balance);
@@ -206,6 +211,9 @@ pub mod actions {
206211
/// Increment the number of block proposals received
207212
pub fn increment_block_proposals_received() {}
208213

214+
/// Increment the block pre-commits sent counter
215+
pub fn increment_block_pre_commits_sent() {}
216+
209217
/// Update the stx balance of the signer
210218
pub fn update_signer_stx_balance(_balance: i64) {}
211219

stacks-signer/src/monitoring/prometheus.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ lazy_static! {
4848
"The number of block proposals received by the signer"
4949
))
5050
.unwrap();
51+
pub static ref BLOCK_PRE_COMMITS_SENT: IntCounter = register_int_counter!(opts!(
52+
"stacks_signer_block_pre_commits_sent",
53+
"The number of block pre-commits sent by the signer"
54+
))
55+
.unwrap();
5156
pub static ref CURRENT_REWARD_CYCLE: IntGauge = register_int_gauge!(opts!(
5257
"stacks_signer_current_reward_cycle",
5358
"The current reward cycle"

0 commit comments

Comments
 (0)