@@ -413,9 +413,9 @@ fn validate_metrics(
413413 global:: handle_error ( MetricsError :: Other ( format ! ( "Instrument type conflict, using existing type definition. Instrument {name}, Existing: {:?}, dropped: {:?}" , existing. get_field_type( ) , metric_type) ) ) ;
414414 return ( true , None ) ;
415415 }
416- if existing. get_help ( ) != description {
417- global:: handle_error ( MetricsError :: Other ( format ! ( "Instrument description conflict, using existing. Instrument {name}, Existing: {:?}, dropped: {:?}" , existing. get_help ( ) , description) ) ) ;
418- return ( false , Some ( existing. get_help ( ) . to_string ( ) ) ) ;
416+ if existing. help ( ) != description {
417+ global:: handle_error ( MetricsError :: Other ( format ! ( "Instrument description conflict, using existing. Instrument {name}, Existing: {:?}, dropped: {:?}" , existing. help ( ) , description) ) ) ;
418+ return ( false , Some ( existing. help ( ) . to_string ( ) ) ) ;
419419 }
420420 ( false , None )
421421 } else {
@@ -458,16 +458,16 @@ fn add_histogram_metric<T: Numeric>(
458458 let mut h = prometheus:: proto:: Histogram :: default ( ) ;
459459 h. set_sample_sum ( dp. sum . as_f64 ( ) ) ;
460460 h. set_sample_count ( dp. count ) ;
461- h. set_bucket ( protobuf :: RepeatedField :: from_vec ( bucket) ) ;
461+ h. set_bucket ( bucket) ;
462462 let mut pm = prometheus:: proto:: Metric :: default ( ) ;
463- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
463+ pm. set_label ( kvs) ;
464464 pm. set_histogram ( h) ;
465465
466466 let mut mf = prometheus:: proto:: MetricFamily :: default ( ) ;
467467 mf. set_name ( name. to_string ( ) ) ;
468468 mf. set_help ( description. clone ( ) ) ;
469469 mf. set_field_type ( prometheus:: proto:: MetricType :: HISTOGRAM ) ;
470- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
470+ mf. set_metric ( vec ! [ pm] ) ;
471471 res. push ( mf) ;
472472 }
473473}
@@ -489,7 +489,7 @@ fn add_sum_metric<T: Numeric>(
489489 let kvs = get_attrs ( & mut dp. attributes . iter ( ) , extra) ;
490490
491491 let mut pm = prometheus:: proto:: Metric :: default ( ) ;
492- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
492+ pm. set_label ( kvs) ;
493493
494494 if sum. is_monotonic {
495495 let mut c = prometheus:: proto:: Counter :: default ( ) ;
@@ -505,7 +505,7 @@ fn add_sum_metric<T: Numeric>(
505505 mf. set_name ( name. to_string ( ) ) ;
506506 mf. set_help ( description. clone ( ) ) ;
507507 mf. set_field_type ( metric_type) ;
508- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
508+ mf. set_metric ( vec ! [ pm] ) ;
509509 res. push ( mf) ;
510510 }
511511}
@@ -523,14 +523,14 @@ fn add_gauge_metric<T: Numeric>(
523523 let mut g = prometheus:: proto:: Gauge :: default ( ) ;
524524 g. set_value ( dp. value . as_f64 ( ) ) ;
525525 let mut pm = prometheus:: proto:: Metric :: default ( ) ;
526- pm. set_label ( protobuf :: RepeatedField :: from_vec ( kvs) ) ;
526+ pm. set_label ( kvs) ;
527527 pm. set_gauge ( g) ;
528528
529529 let mut mf = prometheus:: proto:: MetricFamily :: default ( ) ;
530530 mf. set_name ( name. to_string ( ) ) ;
531531 mf. set_help ( description. to_string ( ) ) ;
532532 mf. set_field_type ( MetricType :: GAUGE ) ;
533- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ pm] ) ) ;
533+ mf. set_metric ( vec ! [ pm] ) ;
534534 res. push ( mf) ;
535535 }
536536}
@@ -544,17 +544,17 @@ fn create_info_metric(
544544 g. set_value ( 1.0 ) ;
545545
546546 let mut m = prometheus:: proto:: Metric :: default ( ) ;
547- m. set_label ( protobuf :: RepeatedField :: from_vec ( get_attrs (
547+ m. set_label ( get_attrs (
548548 & mut resource. iter ( ) ,
549549 & [ ] ,
550- ) ) ) ;
550+ ) ) ;
551551 m. set_gauge ( g) ;
552552
553553 let mut mf = MetricFamily :: default ( ) ;
554554 mf. set_name ( target_info_name. into ( ) ) ;
555555 mf. set_help ( target_info_description. into ( ) ) ;
556556 mf. set_field_type ( MetricType :: GAUGE ) ;
557- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ m] ) ) ;
557+ mf. set_metric ( vec ! [ m] ) ;
558558 mf
559559}
560560
@@ -575,14 +575,14 @@ fn create_scope_info_metric(scope: &Scope) -> MetricFamily {
575575 }
576576
577577 let mut m = prometheus:: proto:: Metric :: default ( ) ;
578- m. set_label ( protobuf :: RepeatedField :: from_vec ( labels) ) ;
578+ m. set_label ( labels) ;
579579 m. set_gauge ( g) ;
580580
581581 let mut mf = MetricFamily :: default ( ) ;
582582 mf. set_name ( SCOPE_INFO_METRIC_NAME . into ( ) ) ;
583583 mf. set_help ( SCOPE_INFO_DESCRIPTION . into ( ) ) ;
584584 mf. set_field_type ( MetricType :: GAUGE ) ;
585- mf. set_metric ( protobuf :: RepeatedField :: from_vec ( vec ! [ m] ) ) ;
585+ mf. set_metric ( vec ! [ m] ) ;
586586 mf
587587}
588588
0 commit comments