Skip to content

Commit fce08ea

Browse files
apollo_consensus_orchestrator: add SNIP-35 metrics
1 parent d28c88a commit fce08ea

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • crates/apollo_consensus_orchestrator/src

crates/apollo_consensus_orchestrator/src/metrics.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ define_metrics!(
3232
LabeledMetricCounter { CONSENSUS_BUILD_PROPOSAL_FAILURE , "consensus_build_proposal_failure", "Number of failures while building a proposal", init = 0, labels = BUILD_PROPOSAL_FAILURE_REASON },
3333
// Proposal validation failure metrics
3434
LabeledMetricCounter { CONSENSUS_VALIDATE_PROPOSAL_FAILURE , "consensus_validate_proposal_failure", "Number of failures while validating a proposal", init = 0, labels = VALIDATE_PROPOSAL_FAILURE_REASON },
35+
36+
// SNIP-35 dynamic gas pricing metrics
37+
MetricGauge { SNIP35_FEE_ACTUAL, "snip35_fee_actual", "The current fee_actual (median of recent fee_proposals sliding window)" },
38+
MetricGauge { SNIP35_FEE_PROPOSAL, "snip35_fee_proposal", "The fee_proposal this node published in the latest block" },
39+
MetricGauge { SNIP35_FEE_TARGET, "snip35_fee_target", "The fee_target computed from the STRK/USD oracle" },
40+
MetricGauge { SNIP35_STRK_USD_RATE, "snip35_strk_usd_rate", "The STRK/USD rate from the oracle" },
3541
}
3642
);
3743

@@ -100,4 +106,8 @@ pub(crate) fn register_metrics() {
100106
CONSENSUS_BUILD_PROPOSAL_FAILURE.register();
101107
CONSENSUS_VALIDATE_PROPOSAL_FAILURE.register();
102108
CONSENSUS_PROOF_MANAGER_STORE_LATENCY.register();
109+
SNIP35_FEE_ACTUAL.register();
110+
SNIP35_FEE_PROPOSAL.register();
111+
SNIP35_FEE_TARGET.register();
112+
SNIP35_STRK_USD_RATE.register();
103113
}

0 commit comments

Comments
 (0)