-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tee): add Prometheus metrics to the TEE Prover (#2386)
## What ❔ This commit adds Prometheus metrics to the TEE Prover. Specifically, the following metrics were added: - Waiting time for a new batch to be proven - Proof generation time - Proof submitting time - Network error counter - Last block number processed ## Why ❔ Setting up Prometheus metrics is a prerequisite before rolling them out to staging and testnet environments. Prometheus metrics are useful for monitoring, providing valuable insights into the running system. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`.
- Loading branch information
Showing
8 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! Metrics for the TEE Prover. | ||
use std::time::Duration; | ||
|
||
use vise::{Buckets, Gauge, Histogram, Metrics, Unit}; | ||
|
||
#[derive(Debug, Metrics)] | ||
#[metrics(prefix = "tee_prover")] | ||
pub(crate) struct TeeProverMetrics { | ||
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)] | ||
pub job_waiting_time: Histogram<Duration>, | ||
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)] | ||
pub proof_generation_time: Histogram<Duration>, | ||
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)] | ||
pub proof_submitting_time: Histogram<Duration>, | ||
pub network_errors_counter: Gauge<u64>, | ||
pub last_batch_number_processed: Gauge<u64>, | ||
} | ||
|
||
#[vise::register] | ||
pub(super) static METRICS: vise::Global<TeeProverMetrics> = vise::Global::new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters