cat_gateway/metrics/mod.rs
1//! This module contains submodules related to metrics report and analytics.
2
3use prometheus::{default_registry, Registry};
4
5pub(crate) mod caches;
6pub(crate) mod chain_follower;
7pub(crate) mod chain_indexer;
8pub(crate) mod endpoint;
9pub(crate) mod health;
10pub(crate) mod memory;
11
12/// Initialize Prometheus metrics.
13///
14/// ## Returns
15///
16/// Returns the default prometheus registry.
17#[must_use]
18pub(crate) fn init_prometheus() -> Registry {
19 default_registry().clone()
20}
21
22/// Updates metrics to current values.
23pub(crate) fn metrics_updater_fn() {
24 chain_follower::update();
25 memory::update();
26 health::update();
27 caches::update();
28}