Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ethereum_prover/configs/ethproofs_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ eth_prover:
block_mod: 100
prover_id: 0
on_failure: "continue"
prometheus_port: 9898
1 change: 1 addition & 0 deletions ethereum_prover/configs/ethproofs_staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ eth_prover:
block_mod: 10
prover_id: 0
on_failure: "continue"
prometheus_port: 9898
3 changes: 2 additions & 1 deletion ethereum_prover/configs/local_debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ eth_prover:
ethproofs_submission: "off"
block_mod: 1
prover_id: 0
on_failure: "exit"
on_failure: "continue"
prometheus_port: 9898

2 changes: 1 addition & 1 deletion ethereum_prover/src/clients/ethproofs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl EthproofsClient {
payload: &T,
context: &'static str,
) -> anyhow::Result<()> {
let latency = METRICS.ethproofs_request_duration_seconds.start();
let latency = METRICS.ethproofs_request_duration.start();
for attempt in 1..=MAX_ATTEMPTS {
let response = self
.client
Expand Down
6 changes: 3 additions & 3 deletions ethereum_prover/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ pub struct ProverMetrics {
pub witness_success_total: Counter<u64>,
pub witness_failure_total: Counter<u64>,
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)]
pub witness_duration_seconds: Histogram<Duration>,
pub witness_duration: Histogram<Duration>,
pub inflight_witness_tasks: Gauge<u64>,
pub proof_success_total: Counter<u64>,
pub proof_failure_total: Counter<u64>,
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)]
pub proof_duration_seconds: Histogram<Duration>,
pub proof_duration: Histogram<Duration>,
pub inflight_proof_tasks: Gauge<u64>,
pub last_processed_block: Gauge<u64>,
pub ethproofs_request_success_total: Counter<u64>,
pub ethproofs_request_failure_total: Counter<u64>,
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)]
pub ethproofs_request_duration_seconds: Histogram<Duration>,
pub ethproofs_request_duration: Histogram<Duration>,
}

#[vise::register]
Expand Down
2 changes: 1 addition & 1 deletion ethereum_prover/src/tasks/cpu_witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl CpuWitnessTask {
);
let block_number = witness.block_header.number;
let _inflight = InflightGuard::new(&METRICS.inflight_witness_tasks);
let latency = METRICS.witness_duration_seconds.start();
let latency = METRICS.witness_duration.start();
match self.process_block(witness).await {
Ok(cpu_witness) => {
tracing::info!("Generated CPU witness for block {}", block_number);
Expand Down
2 changes: 1 addition & 1 deletion ethereum_prover/src/tasks/gpu_prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl GpuProveTask {
);
let block_number = witness.block_header.number;
let _inflight = InflightGuard::new(&METRICS.inflight_proof_tasks);
let latency = METRICS.proof_duration_seconds.start();
let latency = METRICS.proof_duration.start();
self.command_sender
.send(CalculationUpdate::ProofQueued { block_number })
.await
Expand Down
44 changes: 44 additions & 0 deletions infra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Infra: Local Metrics Stack

This folder contains a local Prometheus + Grafana setup for `ethereum_prover`, plus a
TypeScript (Grafana Foundation SDK) dashboard generator.

## Layout

- `infra/docker-compose.yml`: Prometheus + Grafana services.
- `infra/prometheus/prometheus.yml`: Prometheus scrape config (targets host at `9898`).
- `infra/grafana/provisioning/`: Grafana datasource + dashboard provisioning.
- `infra/grafana/dashboards/`: Generated dashboard JSON output.
- `infra/dashboards/`: Dashboard source (TypeScript) and build script.

## Prerequisites

- `docker` + `docker compose`
- `node` + `yarn` (for dashboard generation)
- `ethereum_prover` running on host with metrics enabled:
- `eth_prover_prometheus_port=9898`

## Generate dashboards

From repo root:

```sh
./infra/dashboards/build.sh
```

This writes `infra/grafana/dashboards/ethereum-prover.json`.

## Run Prometheus + Grafana

```sh
docker compose -f infra/docker-compose.yml up
```

Grafana: http://localhost:3000

Prometheus: http://localhost:9090

## Notes

- Prometheus scrapes `host.docker.internal:9898`. On Linux, `host.docker.internal`
is provided via `extra_hosts: host-gateway` in the compose file.
3 changes: 3 additions & 0 deletions infra/dashboards/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/dist
/node_modules
/wasm
8 changes: 8 additions & 0 deletions infra/dashboards/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$script_dir"

yarn install
yarn build
17 changes: 17 additions & 0 deletions infra/dashboards/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "ethereum-prover-dashboards",
"private": true,
"type": "commonjs",
"scripts": {
"build": "ts-node ./src/ethereum-prover-dashboard.ts"
},
"dependencies": {
"@grafana/grafana-foundation-sdk": "~11.6.0-cogv0.0.x.1746136285",
"tslib": "^2.6.3"
},
"devDependencies": {
"@types/node": "^22.10.2",
"ts-node": "^10.9.2",
"typescript": "^5.6.3"
}
}
Loading