mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 21:01:02 +00:00
Pre-create metrics registry before loop is started + administrative metrics (#848)
* administrative metrics * fmt * fix compilation * fix compilation again * and another one * remove GenericLoopMetrics * chttp -> isahc * remove redundant marker * not about price metrics * fmt
This commit is contained in:
committed by
Bastian Köcher
parent
21baffc832
commit
cb90ea0979
@@ -66,7 +66,7 @@ pub struct EthereumExchangeParams {
|
||||
/// Relay working mode.
|
||||
pub mode: ExchangeRelayMode,
|
||||
/// Metrics parameters.
|
||||
pub metrics_params: Option<MetricsParams>,
|
||||
pub metrics_params: MetricsParams,
|
||||
/// Instance of the bridge pallet being synchronized.
|
||||
pub instance: Arc<dyn BridgeInstance>,
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ pub struct EthereumSyncParams {
|
||||
/// Synchronization parameters.
|
||||
pub sync_params: HeadersSyncParams,
|
||||
/// Metrics parameters.
|
||||
pub metrics_params: Option<MetricsParams>,
|
||||
pub metrics_params: MetricsParams,
|
||||
/// Instance of the bridge pallet being synchronized.
|
||||
pub instance: Arc<dyn BridgeInstance>,
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@ use ethereum_sync_loop::EthereumSyncParams;
|
||||
use headers_relay::sync::TargetTransactionMode;
|
||||
use hex_literal::hex;
|
||||
use instances::{BridgeInstance, Kovan, RialtoPoA};
|
||||
use relay_utils::{initialize::initialize_relay, metrics::MetricsParams};
|
||||
use relay_utils::{
|
||||
initialize::initialize_relay,
|
||||
metrics::{MetricsAddress, MetricsParams},
|
||||
};
|
||||
use secp256k1::SecretKey;
|
||||
use sp_core::crypto::Pair;
|
||||
use substrate_sync_loop::SubstrateSyncParams;
|
||||
@@ -367,12 +370,12 @@ fn ethereum_exchange_params(matches: &clap::ArgMatches) -> Result<EthereumExchan
|
||||
Ok(params)
|
||||
}
|
||||
|
||||
fn metrics_params(matches: &clap::ArgMatches) -> Result<Option<MetricsParams>, String> {
|
||||
fn metrics_params(matches: &clap::ArgMatches) -> Result<MetricsParams, String> {
|
||||
if matches.is_present("no-prometheus") {
|
||||
return Ok(None);
|
||||
return Ok(None.into());
|
||||
}
|
||||
|
||||
let mut metrics_params = MetricsParams::default();
|
||||
let mut metrics_params = MetricsAddress::default();
|
||||
|
||||
if let Some(prometheus_host) = matches.value_of("prometheus-host") {
|
||||
metrics_params.host = prometheus_host.into();
|
||||
@@ -383,7 +386,7 @@ fn metrics_params(matches: &clap::ArgMatches) -> Result<Option<MetricsParams>, S
|
||||
.map_err(|e| format!("Failed to parse prometheus-port: {}", e))?;
|
||||
}
|
||||
|
||||
Ok(Some(metrics_params))
|
||||
Ok(Some(metrics_params).into())
|
||||
}
|
||||
|
||||
fn instance_params(matches: &clap::ArgMatches) -> Result<Arc<dyn BridgeInstance>, String> {
|
||||
|
||||
@@ -68,7 +68,7 @@ pub struct SubstrateSyncParams {
|
||||
/// Synchronization parameters.
|
||||
pub sync_params: HeadersSyncParams,
|
||||
/// Metrics parameters.
|
||||
pub metrics_params: Option<MetricsParams>,
|
||||
pub metrics_params: MetricsParams,
|
||||
}
|
||||
|
||||
/// Substrate synchronization pipeline.
|
||||
|
||||
Reference in New Issue
Block a user