mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
refactor: add basic counter metrics for IMC (#5006)
This commit is contained in:
@ -120,3 +120,18 @@ macro_rules! gauge_metric {
|
||||
> = once_cell::sync::Lazy::new(|| $meter.u64_observable_gauge($description).init());
|
||||
};
|
||||
}
|
||||
|
||||
pub use helpers::add_attributes;
|
||||
|
||||
mod helpers {
|
||||
pub fn add_attributes<T, U>(attributes: U) -> Vec<opentelemetry::KeyValue>
|
||||
where
|
||||
T: Into<opentelemetry::Value>,
|
||||
U: IntoIterator<Item = (&'static str, T)>,
|
||||
{
|
||||
attributes
|
||||
.into_iter()
|
||||
.map(|(key, value)| opentelemetry::KeyValue::new(key, value))
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user