@@ -690,8 +690,8 @@ mod tests {
690
690
"There should be single metric merging duplicate instruments"
691
691
) ;
692
692
let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
693
- assert_eq ! ( metric. name, "my_counter" ) ;
694
- assert_eq ! ( metric. unit, "my_unit" ) ;
693
+ assert_eq ! ( metric. instrument . name, "my_counter" ) ;
694
+ assert_eq ! ( metric. instrument . unit, "my_unit" ) ;
695
695
let MetricData :: Sum ( sum) = u64:: extract_metrics_data_ref ( & metric. data )
696
696
. expect ( "Sum aggregation expected for Counter instruments by default" )
697
697
else {
@@ -756,9 +756,9 @@ mod tests {
756
756
757
757
if let Some ( scope1) = scope1 {
758
758
let metric1 = & scope1. metrics [ 0 ] ;
759
- assert_eq ! ( metric1. name, "my_counter" ) ;
760
- assert_eq ! ( metric1. unit, "my_unit" ) ;
761
- assert_eq ! ( metric1. description, "my_description" ) ;
759
+ assert_eq ! ( metric1. instrument . name, "my_counter" ) ;
760
+ assert_eq ! ( metric1. instrument . unit, "my_unit" ) ;
761
+ assert_eq ! ( metric1. instrument . description, "my_description" ) ;
762
762
let MetricData :: Sum ( sum1) = u64:: extract_metrics_data_ref ( & metric1. data )
763
763
. expect ( "Sum aggregation expected for Counter instruments by default" )
764
764
else {
@@ -776,9 +776,9 @@ mod tests {
776
776
777
777
if let Some ( scope2) = scope2 {
778
778
let metric2 = & scope2. metrics [ 0 ] ;
779
- assert_eq ! ( metric2. name, "my_counter" ) ;
780
- assert_eq ! ( metric2. unit, "my_unit" ) ;
781
- assert_eq ! ( metric2. description, "my_description" ) ;
779
+ assert_eq ! ( metric2. instrument . name, "my_counter" ) ;
780
+ assert_eq ! ( metric2. instrument . unit, "my_unit" ) ;
781
+ assert_eq ! ( metric2. instrument . description, "my_description" ) ;
782
782
783
783
let MetricData :: Sum ( sum2) = u64:: extract_metrics_data_ref ( & metric2. data )
784
784
. expect ( "Sum aggregation expected for Counter instruments by default" )
@@ -862,9 +862,9 @@ mod tests {
862
862
assert ! ( scope. attributes( ) . eq( & [ KeyValue :: new( "key" , "value1" ) ] ) ) ;
863
863
864
864
let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
865
- assert_eq ! ( metric. name, "my_counter" ) ;
866
- assert_eq ! ( metric. unit, "my_unit" ) ;
867
- assert_eq ! ( metric. description, "my_description" ) ;
865
+ assert_eq ! ( metric. instrument . name, "my_counter" ) ;
866
+ assert_eq ! ( metric. instrument . unit, "my_unit" ) ;
867
+ assert_eq ! ( metric. instrument . description, "my_description" ) ;
868
868
869
869
let MetricData :: Sum ( sum) = u64:: extract_metrics_data_ref ( & metric. data )
870
870
. expect ( "Sum aggregation expected for Counter instruments by default" )
@@ -919,11 +919,11 @@ mod tests {
919
919
assert ! ( !resource_metrics. is_empty( ) ) ;
920
920
let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
921
921
assert_eq ! (
922
- metric. name, "test_histogram" ,
922
+ metric. instrument . name, "test_histogram" ,
923
923
"View rename should be ignored and original name retained."
924
924
) ;
925
925
assert_eq ! (
926
- metric. unit, "test_unit" ,
926
+ metric. instrument . unit, "test_unit" ,
927
927
"View rename of unit should be ignored and original unit retained."
928
928
) ;
929
929
}
@@ -985,7 +985,7 @@ mod tests {
985
985
. expect ( "metrics are expected to be exported." ) ;
986
986
assert ! ( !resource_metrics. is_empty( ) ) ;
987
987
let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
988
- assert_eq ! ( metric. name, "my_observable_counter" , ) ;
988
+ assert_eq ! ( metric. instrument . name, "my_observable_counter" , ) ;
989
989
990
990
let MetricData :: Sum ( sum) = u64:: extract_metrics_data_ref ( & metric. data )
991
991
. expect ( "Sum aggregation expected for ObservableCounter instruments by default" )
@@ -1061,7 +1061,7 @@ mod tests {
1061
1061
. expect ( "metrics are expected to be exported." ) ;
1062
1062
assert ! ( !resource_metrics. is_empty( ) ) ;
1063
1063
let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
1064
- assert_eq ! ( metric. name, "my_counter" , ) ;
1064
+ assert_eq ! ( metric. instrument . name, "my_counter" , ) ;
1065
1065
1066
1066
let MetricData :: Sum ( sum) = u64:: extract_metrics_data_ref ( & metric. data )
1067
1067
. expect ( "Sum aggregation expected for Counter instruments by default" )
@@ -3029,9 +3029,9 @@ mod tests {
3029
3029
assert ! ( !resource_metric. scope_metrics[ 0 ] . metrics. is_empty( ) ) ;
3030
3030
3031
3031
let metric = & resource_metric. scope_metrics [ 0 ] . metrics [ 0 ] ;
3032
- assert_eq ! ( metric. name, counter_name) ;
3032
+ assert_eq ! ( metric. instrument . name, counter_name) ;
3033
3033
if let Some ( expected_unit) = unit_name {
3034
- assert_eq ! ( metric. unit, expected_unit) ;
3034
+ assert_eq ! ( metric. instrument . unit, expected_unit) ;
3035
3035
}
3036
3036
3037
3037
T :: extract_metrics_data_ref ( & metric. data )
@@ -3073,10 +3073,10 @@ mod tests {
3073
3073
assert ! ( !resource_metric. scope_metrics[ 0 ] . metrics. is_empty( ) ) ;
3074
3074
3075
3075
let metric = & resource_metric. scope_metrics [ 0 ] . metrics [ 0 ] ;
3076
- assert_eq ! ( metric. name, counter_name) ;
3076
+ assert_eq ! ( metric. instrument . name, counter_name) ;
3077
3077
3078
3078
if let Some ( expected_unit) = unit_name {
3079
- assert_eq ! ( metric. unit, expected_unit) ;
3079
+ assert_eq ! ( metric. instrument . unit, expected_unit) ;
3080
3080
}
3081
3081
3082
3082
let aggregation = T :: extract_metrics_data_ref ( & metric. data )
0 commit comments