mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Exchange transactions relay dashboard (#241)
* update dashboards * cargo fmt --all * Update deployments/rialto/dashboard/prometheus/prometheus.yml Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
ae88e86d6d
commit
8456d0d969
@@ -98,7 +98,12 @@ pub fn run<P: TransactionProofPipeline>(
|
||||
let mut metrics_global = GlobalMetrics::new();
|
||||
let mut metrics_exch = ExchangeLoopMetrics::new();
|
||||
let metrics_enabled = metrics_params.is_some();
|
||||
metrics_start(metrics_params, &metrics_global, &metrics_exch);
|
||||
metrics_start(
|
||||
format!("{}_to_{}_Exchange", P::SOURCE_NAME, P::TARGET_NAME),
|
||||
metrics_params,
|
||||
&metrics_global,
|
||||
&metrics_exch,
|
||||
);
|
||||
|
||||
let exit_signal = exit_signal.fuse();
|
||||
|
||||
|
||||
@@ -45,12 +45,19 @@ pub struct GlobalMetrics {
|
||||
}
|
||||
|
||||
/// Start Prometheus endpoint with given metrics registry.
|
||||
pub fn start(params: Option<MetricsParams>, global_metrics: &GlobalMetrics, extra_metrics: &impl Metrics) {
|
||||
pub fn start(
|
||||
prefix: String,
|
||||
params: Option<MetricsParams>,
|
||||
global_metrics: &GlobalMetrics,
|
||||
extra_metrics: &impl Metrics,
|
||||
) {
|
||||
let params = match params {
|
||||
Some(params) => params,
|
||||
None => return,
|
||||
};
|
||||
|
||||
assert!(!prefix.is_empty(), "Metrics prefix can not be empty");
|
||||
|
||||
let do_start = move || {
|
||||
let prometheus_socket_addr = SocketAddr::new(
|
||||
params
|
||||
@@ -59,7 +66,8 @@ pub fn start(params: Option<MetricsParams>, global_metrics: &GlobalMetrics, extr
|
||||
.map_err(|err| format!("Invalid Prometheus host {}: {}", params.host, err))?,
|
||||
params.port,
|
||||
);
|
||||
let metrics_registry = Registry::new();
|
||||
let metrics_registry =
|
||||
Registry::new_custom(Some(prefix), None).expect("only fails if prefix is empty; prefix is not empty; qed");
|
||||
global_metrics.register(&metrics_registry)?;
|
||||
extra_metrics.register(&metrics_registry)?;
|
||||
async_std::task::spawn(async move {
|
||||
|
||||
@@ -124,7 +124,12 @@ pub fn run<P: HeadersSyncPipeline, TC: TargetClient<P>>(
|
||||
let mut metrics_global = GlobalMetrics::new();
|
||||
let mut metrics_sync = SyncLoopMetrics::new();
|
||||
let metrics_enabled = metrics_params.is_some();
|
||||
metrics_start(metrics_params, &metrics_global, &metrics_sync);
|
||||
metrics_start(
|
||||
format!("{}_to_{}_Sync", P::SOURCE_NAME, P::TARGET_NAME),
|
||||
metrics_params,
|
||||
&metrics_global,
|
||||
&metrics_sync,
|
||||
);
|
||||
|
||||
let mut source_retry_backoff = retry_backoff();
|
||||
let mut source_client_is_online = false;
|
||||
|
||||
Reference in New Issue
Block a user