mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
refactor: add basic counter metrics for IMC (#5006)
This commit is contained in:
@ -12,6 +12,7 @@ use common_utils::errors::ReportSwitchExt;
|
||||
use error_stack::ResultExt;
|
||||
use router_env::{
|
||||
instrument, logger,
|
||||
metrics::add_attributes,
|
||||
tracing::{self, Instrument},
|
||||
};
|
||||
|
||||
@ -135,10 +136,10 @@ pub async fn get_api_event_metrics(
|
||||
.change_context(AnalyticsError::UnknownError)?
|
||||
{
|
||||
let data = data?;
|
||||
let attributes = &[
|
||||
metrics::request::add_attributes("metric_type", metric.to_string()),
|
||||
metrics::request::add_attributes("source", pool.to_string()),
|
||||
];
|
||||
let attributes = &add_attributes([
|
||||
("metric_type", metric.to_string()),
|
||||
("source", pool.to_string()),
|
||||
]);
|
||||
|
||||
let value = u64::try_from(data.len());
|
||||
if let Ok(val) = value {
|
||||
|
||||
Reference in New Issue
Block a user