mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 14:31:02 +00:00
Unify metric names (#1209)
* unify metric names * refactor standalone metrics * headers sync metrics * post-merge fix * fix compilation * fmt * fix dashboards * fix local dashboards * update Rococo/Wococo runtime version * remove commented code * fixed grumbles * fmt * fixed widget names
This commit is contained in:
committed by
Bastian Köcher
parent
940d7e463b
commit
bbf8b51f9c
@@ -16,17 +16,11 @@
|
||||
|
||||
//! Substrate relay helpers
|
||||
|
||||
use relay_utils::metrics::{FloatJsonValueMetric, PrometheusError, Registry};
|
||||
use relay_utils::metrics::{FloatJsonValueMetric, PrometheusError};
|
||||
|
||||
/// Creates standalone token price metric.
|
||||
pub fn token_price_metric(
|
||||
registry: &Registry,
|
||||
prefix: Option<&str>,
|
||||
token_id: &str,
|
||||
) -> Result<FloatJsonValueMetric, PrometheusError> {
|
||||
pub fn token_price_metric(token_id: &str) -> Result<FloatJsonValueMetric, PrometheusError> {
|
||||
FloatJsonValueMetric::new(
|
||||
registry,
|
||||
prefix,
|
||||
format!("https://api.coingecko.com/api/v3/simple/price?ids={}&vs_currencies=btc", token_id),
|
||||
format!("$.{}.btc", token_id),
|
||||
format!("{}_to_base_conversion_rate", token_id.replace("-", "_")),
|
||||
|
||||
Reference in New Issue
Block a user