mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 11:24:45 +08:00
build(deps): bump opentelemetry crates to 0.27 (#6774)
This commit is contained in:
@ -30,12 +30,11 @@ crate::impl_serializable_secret_id_type!(MerchantId);
|
||||
crate::impl_queryable_id_type!(MerchantId);
|
||||
crate::impl_to_sql_from_sql_id_type!(MerchantId);
|
||||
|
||||
// This is implemented so that we can use merchant id directly as attribute in metrics
|
||||
#[cfg(feature = "metrics")]
|
||||
/// This is implemented so that we can use merchant id directly as attribute in metrics
|
||||
impl From<MerchantId> for router_env::opentelemetry::Value {
|
||||
fn from(val: MerchantId) -> Self {
|
||||
let string_value = val.0 .0 .0;
|
||||
Self::String(router_env::opentelemetry::StringValue::from(string_value))
|
||||
Self::from(val.0 .0 .0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -79,11 +79,10 @@ crate::impl_try_from_cow_str_id_type!(PaymentReferenceId, "payment_reference_id"
|
||||
crate::impl_queryable_id_type!(PaymentReferenceId);
|
||||
crate::impl_to_sql_from_sql_id_type!(PaymentReferenceId);
|
||||
|
||||
// This is implemented so that we can use payment id directly as attribute in metrics
|
||||
#[cfg(feature = "metrics")]
|
||||
/// This is implemented so that we can use payment id directly as attribute in metrics
|
||||
impl From<PaymentId> for router_env::opentelemetry::Value {
|
||||
fn from(val: PaymentId) -> Self {
|
||||
let string_value = val.0 .0 .0;
|
||||
Self::String(router_env::opentelemetry::StringValue::from(string_value))
|
||||
Self::from(val.0 .0 .0)
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,3 +31,11 @@ impl FromStr for ProfileId {
|
||||
Self::try_from(cow_string)
|
||||
}
|
||||
}
|
||||
|
||||
// This is implemented so that we can use profile id directly as attribute in metrics
|
||||
#[cfg(feature = "metrics")]
|
||||
impl From<ProfileId> for router_env::opentelemetry::Value {
|
||||
fn from(val: ProfileId) -> Self {
|
||||
Self::from(val.0 .0 .0)
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,13 +21,12 @@ where
|
||||
pub async fn record_operation_time<F, R>(
|
||||
future: F,
|
||||
metric: &opentelemetry::metrics::Histogram<f64>,
|
||||
metric_context: &opentelemetry::Context,
|
||||
key_value: &[opentelemetry::KeyValue],
|
||||
) -> R
|
||||
where
|
||||
F: futures::Future<Output = R>,
|
||||
{
|
||||
let (result, time) = time_future(future).await;
|
||||
metric.record(metric_context, time.as_secs_f64(), key_value);
|
||||
metric.record(time.as_secs_f64(), key_value);
|
||||
result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user