@@ -439,13 +439,13 @@ fn validate_metrics(
439
439
) ;
440
440
return ( true , None ) ;
441
441
}
442
- if existing. get_help ( ) != description {
442
+ if existing. help ( ) != description {
443
443
otel_warn ! (
444
444
name: "MetricValidationFailed" ,
445
445
message = "Instrument description conflict, using existing" ,
446
- metric_description = format!( "Instrument {name}, Existing: {:?}, dropped: {:?}" , existing. get_help ( ) . to_string( ) , description. to_string( ) ) . as_str( ) ,
446
+ metric_description = format!( "Instrument {name}, Existing: {:?}, dropped: {:?}" , existing. help ( ) . to_string( ) , description. to_string( ) ) . as_str( ) ,
447
447
) ;
448
- return ( false , Some ( existing. get_help ( ) . to_string ( ) ) ) ;
448
+ return ( false , Some ( existing. help ( ) . to_string ( ) ) ) ;
449
449
}
450
450
( false , None )
451
451
} else {
@@ -491,16 +491,16 @@ fn add_histogram_metric<T: Numeric>(
491
491
let mut h = prometheus:: proto:: Histogram :: default ( ) ;
492
492
h. set_sample_sum ( dp. sum . as_f64 ( ) ) ;
493
493
h. set_sample_count ( dp. count ) ;
494
- h. set_bucket ( protobuf :: RepeatedField :: from_vec ( bucket) ) ;
494
+ h. set_bucket ( bucket) ;
495
495
let mut pm = prometheus:: proto:: Metric :: default ( ) ;
496
- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
496
+ pm. set_label ( kvs) ;
497
497
pm. set_histogram ( h) ;
498
498
499
499
let mut mf = prometheus:: proto:: MetricFamily :: default ( ) ;
500
500
mf. set_name ( name. to_string ( ) ) ;
501
501
mf. set_help ( description. clone ( ) ) ;
502
502
mf. set_field_type ( prometheus:: proto:: MetricType :: HISTOGRAM ) ;
503
- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
503
+ mf. set_metric ( vec ! [ pm] ) ;
504
504
res. push ( mf) ;
505
505
}
506
506
}
@@ -525,7 +525,7 @@ fn add_sum_metric<T: Numeric>(
525
525
) ;
526
526
527
527
let mut pm = prometheus:: proto:: Metric :: default ( ) ;
528
- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
528
+ pm. set_label ( kvs) ;
529
529
530
530
if sum. is_monotonic {
531
531
let mut c = prometheus:: proto:: Counter :: default ( ) ;
@@ -541,7 +541,7 @@ fn add_sum_metric<T: Numeric>(
541
541
mf. set_name ( name. to_string ( ) ) ;
542
542
mf. set_help ( description. clone ( ) ) ;
543
543
mf. set_field_type ( metric_type) ;
544
- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
544
+ mf. set_metric ( vec ! [ pm] ) ;
545
545
res. push ( mf) ;
546
546
}
547
547
}
@@ -562,14 +562,14 @@ fn add_gauge_metric<T: Numeric>(
562
562
let mut g = prometheus:: proto:: Gauge :: default ( ) ;
563
563
g. set_value ( dp. value . as_f64 ( ) ) ;
564
564
let mut pm = prometheus:: proto:: Metric :: default ( ) ;
565
- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
565
+ pm. set_label ( kvs) ;
566
566
pm. set_gauge ( g) ;
567
567
568
568
let mut mf = prometheus:: proto:: MetricFamily :: default ( ) ;
569
569
mf. set_name ( name. to_string ( ) ) ;
570
570
mf. set_help ( description. to_string ( ) ) ;
571
571
mf. set_field_type ( MetricType :: GAUGE ) ;
572
- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
572
+ mf. set_metric ( vec ! [ pm] ) ;
573
573
res. push ( mf) ;
574
574
}
575
575
}
@@ -583,17 +583,17 @@ fn create_info_metric(
583
583
g. set_value ( 1.0 ) ;
584
584
585
585
let mut m = prometheus:: proto:: Metric :: default ( ) ;
586
- m. set_label ( protobuf :: RepeatedField :: from_vec ( get_attrs (
586
+ m. set_label ( get_attrs (
587
587
& mut resource. iter ( ) ,
588
588
& [ ] ,
589
- ) ) ) ;
589
+ ) ) ;
590
590
m. set_gauge ( g) ;
591
591
592
592
let mut mf = MetricFamily :: default ( ) ;
593
593
mf. set_name ( target_info_name. into ( ) ) ;
594
594
mf. set_help ( target_info_description. into ( ) ) ;
595
595
mf. set_field_type ( MetricType :: GAUGE ) ;
596
- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ m] ) ) ;
596
+ mf. set_metric ( vec ! [ m] ) ;
597
597
mf
598
598
}
599
599
@@ -614,14 +614,14 @@ fn create_scope_info_metric(scope: &InstrumentationScope) -> MetricFamily {
614
614
}
615
615
616
616
let mut m = prometheus:: proto:: Metric :: default ( ) ;
617
- m. set_label ( protobuf :: RepeatedField :: from_vec ( labels) ) ;
617
+ m. set_label ( labels) ;
618
618
m. set_gauge ( g) ;
619
619
620
620
let mut mf = MetricFamily :: default ( ) ;
621
621
mf. set_name ( SCOPE_INFO_METRIC_NAME . into ( ) ) ;
622
622
mf. set_help ( SCOPE_INFO_DESCRIPTION . into ( ) ) ;
623
623
mf. set_field_type ( MetricType :: GAUGE ) ;
624
- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ m] ) ) ;
624
+ mf. set_metric ( vec ! [ m] ) ;
625
625
mf
626
626
}
627
627
0 commit comments