Skip to content

Commit

Permalink
Merge pull request lunatic-solutions#159 from Roger/fix_prometheus_ex…
Browse files Browse the repository at this point in the history
…porter

Fix prometheus feature
  • Loading branch information
bkolobara committed Dec 1, 2022
2 parents 571993a + 88f7cd7 commit 727712a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/mode/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct Args {
long,
value_name = "PROMETHEUS_HTTP_ADDRESS",
requires = "prometheus",
default_value_t = "0.0.0.0:9927"
default_value_t = String::from("0.0.0.0:9927")
)]
prometheus_http: String,
}
Expand Down Expand Up @@ -172,13 +172,13 @@ pub(crate) async fn execute() -> Result<()> {
};

#[cfg(feature = "prometheus")]
if args.is_present("prometheus") {
if args.prometheus {
let builder = metrics_exporter_prometheus::PrometheusBuilder::new();
let builder = if let Some(addr) = args.value_of("prometheus_http") {
builder.with_http_listener(addr.parse::<std::net::SocketAddr>().unwrap())
} else {
builder
};
let builder = builder.with_http_listener(
args.prometheus_http
.parse::<std::net::SocketAddr>()
.unwrap(),
);

let builder = if let Some(node_id) = node_id {
builder.add_global_label("node_id", node_id.to_string())
Expand Down

0 comments on commit 727712a

Please sign in to comment.