diff --git a/prover/proof_fri_compressor/src/main.rs b/prover/proof_fri_compressor/src/main.rs index 096bf9af7883..32d98f07473c 100644 --- a/prover/proof_fri_compressor/src/main.rs +++ b/prover/proof_fri_compressor/src/main.rs @@ -33,6 +33,8 @@ struct Cli { pub(crate) config_path: Option, #[arg(long)] pub(crate) secrets_path: Option, + #[arg(long)] + pub(crate) prometheus_port: Option, } #[tokio::main] @@ -69,9 +71,12 @@ async fn main() -> anyhow::Result<()> { } let _guard = builder.build(); - let config = general_config + let mut config = general_config .proof_compressor_config .context("FriProofCompressorConfig")?; + if let Some(prometheus_port) = opt.prometheus_port { + config.prometheus_listener_port = prometheus_port; + } let pool = ConnectionPool::::singleton(database_secrets.prover_url()?) .build() .await diff --git a/prover/prover_fri/src/main.rs b/prover/prover_fri/src/main.rs index 048eecb05cff..f7d622edb13e 100644 --- a/prover/prover_fri/src/main.rs +++ b/prover/prover_fri/src/main.rs @@ -94,7 +94,10 @@ async fn main() -> anyhow::Result<()> { tracing::info!("No sentry URL was provided"); } - let prover_config = general_config.prover_config.context("fri_prover config")?; + let mut prover_config = general_config.prover_config.context("fri_prover config")?; + if let Some(prometheus_port) = opt.prometheus_port { + prover_config.prometheus_port = prometheus_port; + } let exporter_config = PrometheusExporterConfig::pull(prover_config.prometheus_port); let (stop_signal_sender, stop_signal_receiver) = oneshot::channel(); @@ -317,4 +320,6 @@ pub(crate) struct Cli { pub(crate) config_path: Option, #[arg(long)] pub(crate) secrets_path: Option, + #[arg(long)] + pub(crate) prometheus_port: Option, } diff --git a/prover/prover_fri_gateway/src/main.rs b/prover/prover_fri_gateway/src/main.rs index f818e04c5eaf..4d22dc1c0b5d 100644 --- a/prover/prover_fri_gateway/src/main.rs +++ b/prover/prover_fri_gateway/src/main.rs @@ -44,10 +44,14 @@ async fn main() -> anyhow::Result<()> { } let _guard = builder.build(); - let config = general_config + let mut config = general_config .prover_gateway .context("prover gateway config")?; + if let Some(prometheus_port) = opt.prometheus_port { + config.prometheus_listener_port = prometheus_port; + } + let postgres_config = general_config.postgres_config.context("postgres config")?; let pool = ConnectionPool::::builder( database_secrets.prover_url()?, @@ -123,4 +127,6 @@ pub(crate) struct Cli { pub(crate) config_path: Option, #[arg(long)] pub(crate) secrets_path: Option, + #[arg(long)] + pub(crate) prometheus_port: Option, } diff --git a/prover/witness_generator/src/main.rs b/prover/witness_generator/src/main.rs index 661965b75061..996e9bdacfb3 100644 --- a/prover/witness_generator/src/main.rs +++ b/prover/witness_generator/src/main.rs @@ -65,6 +65,9 @@ struct Opt { /// Path to the secrets file. #[structopt(long)] secrets_path: Option, + /// Prometheus listener port. + #[structopt(long)] + prometheus_port: Option, } #[tokio::main] @@ -122,9 +125,13 @@ async fn main() -> anyhow::Result<()> { let config = general_config .witness_generator .context("witness generator config")?; - let prometheus_config = general_config + let mut prometheus_config = general_config .prometheus_config .context("prometheus config")?; + if let Some(prometheus_port) = opt.prometheus_port { + prometheus_config.listener_port = prometheus_port; + } + let postgres_config = general_config.postgres_config.context("postgres config")?; let connection_pool = ConnectionPool::::builder( database_secrets.master_url()?, diff --git a/prover/witness_vector_generator/src/main.rs b/prover/witness_vector_generator/src/main.rs index 1649c8e82acd..76f796bf156b 100644 --- a/prover/witness_vector_generator/src/main.rs +++ b/prover/witness_vector_generator/src/main.rs @@ -31,6 +31,8 @@ struct Cli { pub(crate) config_path: Option, #[arg(long)] pub(crate) secrets_path: Option, + #[arg(long)] + pub(crate) prometheus_port: Option, } #[tokio::main] @@ -66,9 +68,12 @@ async fn main() -> anyhow::Result<()> { } let _guard = builder.build(); - let config = general_config + let mut config = general_config .witness_vector_generator .context("witness vector generator config")?; + if let Some(prometheus_port) = opt.prometheus_port { + config.prometheus_listener_port = prometheus_port; + } let specialized_group_id = config.specialized_group_id; let exporter_config = PrometheusExporterConfig::pull(config.prometheus_listener_port);