Skip to content

Commit

Permalink
fix(tee_prover): add prometheus pull listener (#3169)
Browse files Browse the repository at this point in the history
## What ❔

Add a prometheus pull listener.

## Why ❔

To get the metrics out of the zk_tee_prover

## 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 `zkstack dev fmt` and `zkstack dev
lint`.

Signed-off-by: Harald Hoyer <[email protected]>
  • Loading branch information
haraldh authored Oct 25, 2024
1 parent a5028da commit 1ffd22f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/bin/zksync_tee_prover/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ fn main() -> anyhow::Result<()> {
.add_layer(SigintHandlerLayer)
.add_layer(TeeProverLayer::new(tee_prover_config));

if let Some(gateway) = prometheus_config.gateway_endpoint() {
let exporter_config =
PrometheusExporterConfig::push(gateway, prometheus_config.push_interval());
builder.add_layer(PrometheusExporterLayer(exporter_config));
}
let exporter_config = if let Some(gateway) = prometheus_config.gateway_endpoint() {
PrometheusExporterConfig::push(gateway, prometheus_config.push_interval())
} else {
PrometheusExporterConfig::pull(prometheus_config.listener_port)
};
builder.add_layer(PrometheusExporterLayer(exporter_config));

builder.build().run(observability_guard)?;
Ok(())
Expand Down

0 comments on commit 1ffd22f

Please sign in to comment.