@@ -114,9 +114,13 @@ pub mod tonic {
114114 fn from ( rm : & ResourceMetrics ) -> Self {
115115 ExportMetricsServiceRequest {
116116 resource_metrics : vec ! [ TonicResourceMetrics {
117- resource: Some ( ( & rm. resource) . into( ) ) ,
118- scope_metrics: rm. scope_metrics. iter( ) . map( Into :: into) . collect( ) ,
119- schema_url: rm. resource. schema_url( ) . map( Into :: into) . unwrap_or_default( ) ,
117+ resource: Some ( ( rm. resource( ) ) . into( ) ) ,
118+ scope_metrics: rm. scope_metrics( ) . map( Into :: into) . collect( ) ,
119+ schema_url: rm
120+ . resource( )
121+ . schema_url( )
122+ . map( Into :: into)
123+ . unwrap_or_default( ) ,
120124 } ] ,
121125 }
122126 }
@@ -135,10 +139,10 @@ pub mod tonic {
135139 impl From < & SdkScopeMetrics > for TonicScopeMetrics {
136140 fn from ( sm : & SdkScopeMetrics ) -> Self {
137141 TonicScopeMetrics {
138- scope : Some ( ( & sm. scope , None ) . into ( ) ) ,
139- metrics : sm. metrics . iter ( ) . map ( Into :: into) . collect ( ) ,
142+ scope : Some ( ( sm. scope ( ) , None ) . into ( ) ) ,
143+ metrics : sm. metrics ( ) . map ( Into :: into) . collect ( ) ,
140144 schema_url : sm
141- . scope
145+ . scope ( )
142146 . schema_url ( )
143147 . map ( ToOwned :: to_owned)
144148 . unwrap_or_default ( ) ,
@@ -149,11 +153,11 @@ pub mod tonic {
149153 impl From < & SdkMetric > for TonicMetric {
150154 fn from ( metric : & SdkMetric ) -> Self {
151155 TonicMetric {
152- name : metric. name . to_string ( ) ,
153- description : metric. description . to_string ( ) ,
154- unit : metric. unit . to_string ( ) ,
156+ name : metric. name ( ) . to_string ( ) ,
157+ description : metric. description ( ) . to_string ( ) ,
158+ unit : metric. unit ( ) . to_string ( ) ,
155159 metadata : vec ! [ ] , // internal and currently unused
156- data : Some ( match & metric. data {
160+ data : Some ( match metric. data ( ) {
157161 AggregatedMetrics :: F64 ( data) => data. into ( ) ,
158162 AggregatedMetrics :: U64 ( data) => data. into ( ) ,
159163 AggregatedMetrics :: I64 ( data) => data. into ( ) ,
@@ -208,17 +212,16 @@ pub mod tonic {
208212 fn from ( hist : & SdkHistogram < T > ) -> Self {
209213 TonicHistogram {
210214 data_points : hist
211- . data_points
212- . iter ( )
215+ . data_points ( )
213216 . map ( |dp| TonicHistogramDataPoint {
214- attributes : dp. attributes . iter ( ) . map ( Into :: into) . collect ( ) ,
217+ attributes : dp. attributes ( ) . map ( Into :: into) . collect ( ) ,
215218 start_time_unix_nano : to_nanos ( hist. start_time ) ,
216219 time_unix_nano : to_nanos ( hist. time ) ,
217220 count : dp. count ,
218221 sum : Some ( dp. sum . into_f64 ( ) ) ,
219- bucket_counts : dp. bucket_counts . clone ( ) ,
220- explicit_bounds : dp. bounds . clone ( ) ,
221- exemplars : dp. exemplars . iter ( ) . map ( Into :: into) . collect ( ) ,
222+ bucket_counts : dp. bucket_counts ( ) . collect ( ) ,
223+ explicit_bounds : dp. bounds ( ) . collect ( ) ,
224+ exemplars : dp. exemplars ( ) . map ( Into :: into) . collect ( ) ,
222225 flags : TonicDataPointFlags :: default ( ) as u32 ,
223226 min : dp. min . map ( Numeric :: into_f64) ,
224227 max : dp. max . map ( Numeric :: into_f64) ,
@@ -236,10 +239,9 @@ pub mod tonic {
236239 fn from ( hist : & SdkExponentialHistogram < T > ) -> Self {
237240 TonicExponentialHistogram {
238241 data_points : hist
239- . data_points
240- . iter ( )
242+ . data_points ( )
241243 . map ( |dp| TonicExponentialHistogramDataPoint {
242- attributes : dp. attributes . iter ( ) . map ( Into :: into) . collect ( ) ,
244+ attributes : dp. attributes ( ) . map ( Into :: into) . collect ( ) ,
243245 start_time_unix_nano : to_nanos ( hist. start_time ) ,
244246 time_unix_nano : to_nanos ( hist. time ) ,
245247 count : dp. count as u64 ,
@@ -255,7 +257,7 @@ pub mod tonic {
255257 bucket_counts : dp. negative_bucket . counts . clone ( ) ,
256258 } ) ,
257259 flags : TonicDataPointFlags :: default ( ) as u32 ,
258- exemplars : dp. exemplars . iter ( ) . map ( Into :: into) . collect ( ) ,
260+ exemplars : dp. exemplars ( ) . map ( Into :: into) . collect ( ) ,
259261 min : dp. min . map ( Numeric :: into_f64) ,
260262 max : dp. max . map ( Numeric :: into_f64) ,
261263 zero_threshold : dp. zero_threshold ,
@@ -273,13 +275,12 @@ pub mod tonic {
273275 fn from ( sum : & SdkSum < T > ) -> Self {
274276 TonicSum {
275277 data_points : sum
276- . data_points
277- . iter ( )
278+ . data_points ( )
278279 . map ( |dp| TonicNumberDataPoint {
279- attributes : dp. attributes . iter ( ) . map ( Into :: into) . collect ( ) ,
280+ attributes : dp. attributes ( ) . map ( Into :: into) . collect ( ) ,
280281 start_time_unix_nano : to_nanos ( sum. start_time ) ,
281282 time_unix_nano : to_nanos ( sum. time ) ,
282- exemplars : dp. exemplars . iter ( ) . map ( Into :: into) . collect ( ) ,
283+ exemplars : dp. exemplars ( ) . map ( Into :: into) . collect ( ) ,
283284 flags : TonicDataPointFlags :: default ( ) as u32 ,
284285 value : Some ( dp. value . into ( ) ) ,
285286 } )
@@ -297,13 +298,12 @@ pub mod tonic {
297298 fn from ( gauge : & SdkGauge < T > ) -> Self {
298299 TonicGauge {
299300 data_points : gauge
300- . data_points
301- . iter ( )
301+ . data_points ( )
302302 . map ( |dp| TonicNumberDataPoint {
303- attributes : dp. attributes . iter ( ) . map ( Into :: into) . collect ( ) ,
303+ attributes : dp. attributes ( ) . map ( Into :: into) . collect ( ) ,
304304 start_time_unix_nano : gauge. start_time . map ( to_nanos) . unwrap_or_default ( ) ,
305305 time_unix_nano : to_nanos ( gauge. time ) ,
306- exemplars : dp. exemplars . iter ( ) . map ( Into :: into) . collect ( ) ,
306+ exemplars : dp. exemplars ( ) . map ( Into :: into) . collect ( ) ,
307307 flags : TonicDataPointFlags :: default ( ) as u32 ,
308308 value : Some ( dp. value . into ( ) ) ,
309309 } )
@@ -319,8 +319,7 @@ pub mod tonic {
319319 fn from ( ex : & SdkExemplar < T > ) -> Self {
320320 TonicExemplar {
321321 filtered_attributes : ex
322- . filtered_attributes
323- . iter ( )
322+ . filtered_attributes ( )
324323 . map ( |kv| ( & kv. key , & kv. value ) . into ( ) )
325324 . collect ( ) ,
326325 time_unix_nano : to_nanos ( ex. time ) ,
0 commit comments