mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
Pass Prometheus Registry into Client (#5120)
* Add a few metrics to Client * Improve PrometheusConfig * Fix client docs
This commit is contained in:
@@ -24,7 +24,7 @@ use regex::Regex;
|
||||
use chrono::prelude::*;
|
||||
use sc_service::{
|
||||
AbstractService, Configuration, ChainSpecExtension, RuntimeGenesis, ChainSpec, Roles,
|
||||
config::KeystoreConfig,
|
||||
config::{KeystoreConfig, PrometheusConfig},
|
||||
};
|
||||
use sc_telemetry::TelemetryEndpoints;
|
||||
|
||||
@@ -423,11 +423,12 @@ impl RunCmd {
|
||||
|
||||
// Override prometheus
|
||||
if self.no_prometheus {
|
||||
config.prometheus_port = None;
|
||||
} else if config.prometheus_port.is_none() {
|
||||
config.prometheus_config = None;
|
||||
} else if config.prometheus_config.is_none() {
|
||||
let prometheus_interface: &str = if self.prometheus_external { "0.0.0.0" } else { "127.0.0.1" };
|
||||
config.prometheus_port = Some(
|
||||
parse_address(&format!("{}:{}", prometheus_interface, 9615), self.prometheus_port)?);
|
||||
config.prometheus_config = Some(PrometheusConfig::new_with_default_registry(
|
||||
parse_address(&format!("{}:{}", prometheus_interface, 9615), self.prometheus_port)?,
|
||||
));
|
||||
}
|
||||
|
||||
config.tracing_targets = self.import_params.tracing_targets.clone().into();
|
||||
|
||||
Reference in New Issue
Block a user