@@ -439,13 +439,13 @@ fn validate_metrics(
439439 ) ;
440440 return ( true , None ) ;
441441 }
442- if existing. get_help ( ) != description {
442+ if existing. help ( ) != description {
443443 otel_warn ! (
444444 name: "MetricValidationFailed" ,
445445 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( ) ,
447447 ) ;
448- return ( false , Some ( existing. get_help ( ) . to_string ( ) ) ) ;
448+ return ( false , Some ( existing. help ( ) . to_string ( ) ) ) ;
449449 }
450450 ( false , None )
451451 } else {
@@ -491,16 +491,16 @@ fn add_histogram_metric<T: Numeric>(
491491 let mut h = prometheus:: proto:: Histogram :: default ( ) ;
492492 h. set_sample_sum ( dp. sum . as_f64 ( ) ) ;
493493 h. set_sample_count ( dp. count ) ;
494- h. set_bucket ( protobuf :: RepeatedField :: from_vec ( bucket) ) ;
494+ h. set_bucket ( bucket) ;
495495 let mut pm = prometheus:: proto:: Metric :: default ( ) ;
496- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
496+ pm. set_label ( kvs) ;
497497 pm. set_histogram ( h) ;
498498
499499 let mut mf = prometheus:: proto:: MetricFamily :: default ( ) ;
500500 mf. set_name ( name. to_string ( ) ) ;
501501 mf. set_help ( description. clone ( ) ) ;
502502 mf. set_field_type ( prometheus:: proto:: MetricType :: HISTOGRAM ) ;
503- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
503+ mf. set_metric ( vec ! [ pm] ) ;
504504 res. push ( mf) ;
505505 }
506506}
@@ -525,7 +525,7 @@ fn add_sum_metric<T: Numeric>(
525525 ) ;
526526
527527 let mut pm = prometheus:: proto:: Metric :: default ( ) ;
528- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
528+ pm. set_label ( kvs) ;
529529
530530 if sum. is_monotonic {
531531 let mut c = prometheus:: proto:: Counter :: default ( ) ;
@@ -541,7 +541,7 @@ fn add_sum_metric<T: Numeric>(
541541 mf. set_name ( name. to_string ( ) ) ;
542542 mf. set_help ( description. clone ( ) ) ;
543543 mf. set_field_type ( metric_type) ;
544- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
544+ mf. set_metric ( vec ! [ pm] ) ;
545545 res. push ( mf) ;
546546 }
547547}
@@ -562,14 +562,14 @@ fn add_gauge_metric<T: Numeric>(
562562 let mut g = prometheus:: proto:: Gauge :: default ( ) ;
563563 g. set_value ( dp. value . as_f64 ( ) ) ;
564564 let mut pm = prometheus:: proto:: Metric :: default ( ) ;
565- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
565+ pm. set_label ( kvs) ;
566566 pm. set_gauge ( g) ;
567567
568568 let mut mf = prometheus:: proto:: MetricFamily :: default ( ) ;
569569 mf. set_name ( name. to_string ( ) ) ;
570570 mf. set_help ( description. to_string ( ) ) ;
571571 mf. set_field_type ( MetricType :: GAUGE ) ;
572- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
572+ mf. set_metric ( vec ! [ pm] ) ;
573573 res. push ( mf) ;
574574 }
575575}
@@ -583,17 +583,17 @@ fn create_info_metric(
583583 g. set_value ( 1.0 ) ;
584584
585585 let mut m = prometheus:: proto:: Metric :: default ( ) ;
586- m. set_label ( protobuf :: RepeatedField :: from_vec ( get_attrs (
586+ m. set_label ( get_attrs (
587587 & mut resource. iter ( ) ,
588588 & [ ] ,
589- ) ) ) ;
589+ ) ) ;
590590 m. set_gauge ( g) ;
591591
592592 let mut mf = MetricFamily :: default ( ) ;
593593 mf. set_name ( target_info_name. into ( ) ) ;
594594 mf. set_help ( target_info_description. into ( ) ) ;
595595 mf. set_field_type ( MetricType :: GAUGE ) ;
596- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ m] ) ) ;
596+ mf. set_metric ( vec ! [ m] ) ;
597597 mf
598598}
599599
@@ -614,14 +614,14 @@ fn create_scope_info_metric(scope: &InstrumentationScope) -> MetricFamily {
614614 }
615615
616616 let mut m = prometheus:: proto:: Metric :: default ( ) ;
617- m. set_label ( protobuf :: RepeatedField :: from_vec ( labels) ) ;
617+ m. set_label ( labels) ;
618618 m. set_gauge ( g) ;
619619
620620 let mut mf = MetricFamily :: default ( ) ;
621621 mf. set_name ( SCOPE_INFO_METRIC_NAME . into ( ) ) ;
622622 mf. set_help ( SCOPE_INFO_DESCRIPTION . into ( ) ) ;
623623 mf. set_field_type ( MetricType :: GAUGE ) ;
624- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ m] ) ) ;
624+ mf. set_metric ( vec ! [ m] ) ;
625625 mf
626626}
627627
0 commit comments