Skip to content

Commit

Permalink
Merge pull request #5279 from stacks-network/feat/log-not-starting-me…
Browse files Browse the repository at this point in the history
…trics

chore: log if metrics_endpoint but no feature flag
  • Loading branch information
hstove authored Nov 14, 2024
2 parents 6e0bd5a + e5c2952 commit bac1b07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions stacks-signer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SpawnedSigner
);
let (res_send, res_recv) = channel();
let ev = SignerEventReceiver::new(config.network.is_mainnet());
#[cfg(feature = "monitoring_prom")]
{
crate::monitoring::start_serving_monitoring_metrics(config.clone()).ok();
}
crate::monitoring::start_serving_monitoring_metrics(config.clone()).ok();
let runloop = RunLoop::new(config.clone());
let mut signer: RunLoopSigner<S, T> = libsigner::Signer::new(runloop, ev, res_send);
let running_signer = signer.spawn(endpoint).expect("Failed to spawn signer");
Expand Down
6 changes: 3 additions & 3 deletions stacks-signer/src/monitoring/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ use ::prometheus::HistogramTimer;
#[cfg(feature = "monitoring_prom")]
use slog::slog_error;
#[cfg(not(feature = "monitoring_prom"))]
use slog::slog_warn;
use slog::slog_info;
#[cfg(feature = "monitoring_prom")]
use stacks_common::error;
#[cfg(not(feature = "monitoring_prom"))]
use stacks_common::warn;
use stacks_common::info;

use crate::config::GlobalConfig;

Expand Down Expand Up @@ -143,7 +143,7 @@ pub fn start_serving_monitoring_metrics(config: GlobalConfig) -> Result<(), Stri
#[cfg(not(feature = "monitoring_prom"))]
{
if config.metrics_endpoint.is_some() {
warn!("Not starting monitoring metrics server as the monitoring_prom feature is not enabled");
info!("`metrics_endpoint` is configured for the signer, but the monitoring_prom feature is not enabled. Not starting monitoring metrics server.");
}
}
Ok(())
Expand Down

0 comments on commit bac1b07

Please sign in to comment.