@@ -13,6 +13,7 @@ use common_utils::errors::CustomResult;
13
13
use error_stack:: ResultExt ;
14
14
use router_env:: {
15
15
instrument, logger,
16
+ metrics:: add_attributes,
16
17
tracing:: { self , Instrument } ,
17
18
} ;
18
19
@@ -120,10 +121,10 @@ pub async fn get_metrics(
120
121
match task_type {
121
122
TaskType :: MetricTask ( metric, data) => {
122
123
let data = data?;
123
- let attributes = & [
124
- metrics :: request :: add_attributes ( "metric_type" , metric. to_string ( ) ) ,
125
- metrics :: request :: add_attributes ( "source" , pool. to_string ( ) ) ,
126
- ] ;
124
+ let attributes = & add_attributes ( [
125
+ ( "metric_type" , metric. to_string ( ) ) ,
126
+ ( "source" , pool. to_string ( ) ) ,
127
+ ] ) ;
127
128
128
129
let value = u64:: try_from ( data. len ( ) ) ;
129
130
if let Ok ( val) = value {
@@ -172,10 +173,10 @@ pub async fn get_metrics(
172
173
}
173
174
TaskType :: DistributionTask ( distribution, data) => {
174
175
let data = data?;
175
- let attributes = & [
176
- metrics :: request :: add_attributes ( "distribution_type" , distribution. to_string ( ) ) ,
177
- metrics :: request :: add_attributes ( "source" , pool. to_string ( ) ) ,
178
- ] ;
176
+ let attributes = & add_attributes ( [
177
+ ( "distribution_type" , distribution. to_string ( ) ) ,
178
+ ( "source" , pool. to_string ( ) ) ,
179
+ ] ) ;
179
180
180
181
let value = u64:: try_from ( data. len ( ) ) ;
181
182
if let Ok ( val) = value {
0 commit comments