Skip to content

Commit

Permalink
default off metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Arqu committed May 22, 2024
1 parent 444b181 commit b125d08
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iroh-cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) struct Cli {
#[clap(long, global = true)]
start: bool,

/// Port to serve metrics on. -1 to disable.
/// Port to serve metrics on. Disabled by default.
#[clap(long)]
pub(crate) metrics_port: Option<MetricsPort>,
}
Expand Down Expand Up @@ -184,7 +184,13 @@ impl Cli {
.await
}
Commands::Doctor { command } => {
let config = NodeConfig::load(self.config.as_deref()).await?;
let mut config = NodeConfig::load(self.config.as_deref()).await?;
if let Some(metrics_port) = self.metrics_port {
config.metrics_addr = match metrics_port {
MetricsPort::Disabled => None,
MetricsPort::Port(port) => Some(([127, 0, 0, 1], port).into()),
};
}
self::doctor::run(command, &config).await
}
}
Expand Down

0 comments on commit b125d08

Please sign in to comment.