@@ -46,10 +46,10 @@ fn prometheus_exporter_integration() {
4646 expected_file: "counter.txt" ,
4747 record_metrics: Box :: new( |meter| {
4848 let attrs = vec![
49- Key :: new( "A" ) . string ( "B" ) ,
50- Key :: new( "C" ) . string ( "D" ) ,
51- Key :: new( "E" ) . bool ( true ) ,
52- Key :: new( "F" ) . i64 ( 42 ) ,
49+ KeyValue :: new( "A" , "B" ) ,
50+ KeyValue :: new( "C" , "D" ) ,
51+ KeyValue :: new( "E" , true ) ,
52+ KeyValue :: new( "F" , 42 ) ,
5353 ] ;
5454 let counter = meter
5555 . f64_counter( "foo" )
@@ -60,10 +60,10 @@ fn prometheus_exporter_integration() {
6060 counter. add( 10.3 , & attrs) ;
6161 counter. add( 9.0 , & attrs) ;
6262 let attrs2 = vec![
63- Key :: new( "A" ) . string ( "D" ) ,
64- Key :: new( "C" ) . string ( "B" ) ,
65- Key :: new( "E" ) . bool ( true ) ,
66- Key :: new( "F" ) . i64 ( 42 ) ,
63+ KeyValue :: new( "A" , "D" ) ,
64+ KeyValue :: new( "C" , "B" ) ,
65+ KeyValue :: new( "E" , true ) ,
66+ KeyValue :: new( "F" , 42 ) ,
6767 ] ;
6868 counter. add( 5.0 , & attrs2) ;
6969 } ) ,
@@ -75,10 +75,10 @@ fn prometheus_exporter_integration() {
7575 builder: ExporterBuilder :: default ( ) . without_counter_suffixes( ) ,
7676 record_metrics: Box :: new( |meter| {
7777 let attrs = vec![
78- Key :: new( "A" ) . string ( "B" ) ,
79- Key :: new( "C" ) . string ( "D" ) ,
80- Key :: new( "E" ) . bool ( true ) ,
81- Key :: new( "F" ) . i64 ( 42 ) ,
78+ KeyValue :: new( "A" , "B" ) ,
79+ KeyValue :: new( "C" , "D" ) ,
80+ KeyValue :: new( "E" , true ) ,
81+ KeyValue :: new( "F" , 42 ) ,
8282 ] ;
8383 let counter = meter
8484 . f64_counter( "foo" )
@@ -89,10 +89,10 @@ fn prometheus_exporter_integration() {
8989 counter. add( 10.3 , & attrs) ;
9090 counter. add( 9.0 , & attrs) ;
9191 let attrs2 = vec![
92- Key :: new( "A" ) . string ( "D" ) ,
93- Key :: new( "C" ) . string ( "B" ) ,
94- Key :: new( "E" ) . bool ( true ) ,
95- Key :: new( "F" ) . i64 ( 42 ) ,
92+ KeyValue :: new( "A" , "D" ) ,
93+ KeyValue :: new( "C" , "B" ) ,
94+ KeyValue :: new( "E" , true ) ,
95+ KeyValue :: new( "F" , 42 ) ,
9696 ] ;
9797 counter. add( 5.0 , & attrs2) ;
9898 } ) ,
@@ -102,7 +102,7 @@ fn prometheus_exporter_integration() {
102102 name: "gauge" ,
103103 expected_file: "gauge.txt" ,
104104 record_metrics: Box :: new( |meter| {
105- let attrs = vec![ Key :: new( "A" ) . string ( "B" ) , Key :: new( "C" ) . string ( "D" ) ] ;
105+ let attrs = vec![ KeyValue :: new( "A" , "B" ) , KeyValue :: new( "C" , "D" ) ] ;
106106 let gauge = meter
107107 . f64_up_down_counter( "bar" )
108108 . with_description( "a fun little gauge" )
@@ -117,7 +117,7 @@ fn prometheus_exporter_integration() {
117117 name: "histogram" ,
118118 expected_file: "histogram.txt" ,
119119 record_metrics: Box :: new( |meter| {
120- let attrs = vec![ Key :: new( "A" ) . string ( "B" ) , Key :: new( "C" ) . string ( "D" ) ] ;
120+ let attrs = vec![ KeyValue :: new( "A" , "B" ) , KeyValue :: new( "C" , "D" ) ] ;
121121 let histogram = meter
122122 . f64_histogram( "histogram_baz" )
123123 . with_description( "a very nice histogram" )
@@ -137,11 +137,11 @@ fn prometheus_exporter_integration() {
137137 record_metrics: Box :: new( |meter| {
138138 let attrs = vec![
139139 // exact match, value should be overwritten
140- Key :: new( "A.B" ) . string ( "X" ) ,
141- Key :: new( "A.B" ) . string ( "Q" ) ,
140+ KeyValue :: new( "A.B" , "X" ) ,
141+ KeyValue :: new( "A.B" , "Q" ) ,
142142 // unintended match due to sanitization, values should be concatenated
143- Key :: new( "C.D" ) . string ( "Y" ) ,
144- Key :: new( "C/D" ) . string ( "Z" ) ,
143+ KeyValue :: new( "C.D" , "Y" ) ,
144+ KeyValue :: new( "C/D" , "Z" ) ,
145145 ] ;
146146 let counter = meter
147147 . f64_counter( "foo" )
@@ -159,7 +159,7 @@ fn prometheus_exporter_integration() {
159159 name: "invalid instruments are renamed" ,
160160 expected_file: "sanitized_names.txt" ,
161161 record_metrics: Box :: new( |meter| {
162- let attrs = vec![ Key :: new( "A" ) . string ( "B" ) , Key :: new( "C" ) . string ( "D" ) ] ;
162+ let attrs = vec![ KeyValue :: new( "A" , "B" ) , KeyValue :: new( "C" , "D" ) ] ;
163163 // Valid.
164164 let mut gauge = meter
165165 . f64_up_down_counter( "bar" )
@@ -195,10 +195,10 @@ fn prometheus_exporter_integration() {
195195 expected_file: "empty_resource.txt" ,
196196 record_metrics: Box :: new( |meter| {
197197 let attrs = vec![
198- Key :: new( "A" ) . string ( "B" ) ,
199- Key :: new( "C" ) . string ( "D" ) ,
200- Key :: new( "E" ) . bool ( true ) ,
201- Key :: new( "F" ) . i64 ( 42 ) ,
198+ KeyValue :: new( "A" , "B" ) ,
199+ KeyValue :: new( "C" , "D" ) ,
200+ KeyValue :: new( "E" , true ) ,
201+ KeyValue :: new( "F" , 42 ) ,
202202 ] ;
203203 let counter = meter
204204 . f64_counter( "foo" )
@@ -212,14 +212,14 @@ fn prometheus_exporter_integration() {
212212 } ,
213213 TestCase {
214214 name: "custom resource" ,
215- custom_resource_attrs: vec![ Key :: new( "A" ) . string ( "B" ) , Key :: new( "C" ) . string ( "D" ) ] ,
215+ custom_resource_attrs: vec![ KeyValue :: new( "A" , "B" ) , KeyValue :: new( "C" , "D" ) ] ,
216216 expected_file: "custom_resource.txt" ,
217217 record_metrics: Box :: new( |meter| {
218218 let attrs = vec![
219- Key :: new( "A" ) . string ( "B" ) ,
220- Key :: new( "C" ) . string ( "D" ) ,
221- Key :: new( "E" ) . bool ( true ) ,
222- Key :: new( "F" ) . i64 ( 42 ) ,
219+ KeyValue :: new( "A" , "B" ) ,
220+ KeyValue :: new( "C" , "D" ) ,
221+ KeyValue :: new( "E" , true ) ,
222+ KeyValue :: new( "F" , 42 ) ,
223223 ] ;
224224 let counter = meter
225225 . f64_counter( "foo" )
@@ -237,10 +237,10 @@ fn prometheus_exporter_integration() {
237237 expected_file: "without_target_info.txt" ,
238238 record_metrics: Box :: new( |meter| {
239239 let attrs = vec![
240- Key :: new( "A" ) . string ( "B" ) ,
241- Key :: new( "C" ) . string ( "D" ) ,
242- Key :: new( "E" ) . bool ( true ) ,
243- Key :: new( "F" ) . i64 ( 42 ) ,
240+ KeyValue :: new( "A" , "B" ) ,
241+ KeyValue :: new( "C" , "D" ) ,
242+ KeyValue :: new( "E" , true ) ,
243+ KeyValue :: new( "F" , 42 ) ,
244244 ] ;
245245 let counter = meter
246246 . f64_counter( "foo" )
@@ -257,7 +257,7 @@ fn prometheus_exporter_integration() {
257257 builder: ExporterBuilder :: default ( ) . without_scope_info( ) ,
258258 expected_file: "without_scope_info.txt" ,
259259 record_metrics: Box :: new( |meter| {
260- let attrs = vec![ Key :: new( "A" ) . string ( "B" ) , Key :: new( "C" ) . string ( "D" ) ] ;
260+ let attrs = vec![ KeyValue :: new( "A" , "B" ) , KeyValue :: new( "C" , "D" ) ] ;
261261 let gauge = meter
262262 . i64_up_down_counter( "bar" )
263263 . with_description( "a fun little gauge" )
@@ -275,7 +275,7 @@ fn prometheus_exporter_integration() {
275275 . without_target_info( ) ,
276276 expected_file: "without_scope_and_target_info.txt" ,
277277 record_metrics: Box :: new( |meter| {
278- let attrs = vec![ Key :: new( "A" ) . string ( "B" ) , Key :: new( "C" ) . string ( "D" ) ] ;
278+ let attrs = vec![ KeyValue :: new( "A" , "B" ) , KeyValue :: new( "C" , "D" ) ] ;
279279 let counter = meter
280280 . u64_counter( "bar" )
281281 . with_description( "a fun little counter" )
@@ -292,10 +292,10 @@ fn prometheus_exporter_integration() {
292292 expected_file: "with_namespace.txt" ,
293293 record_metrics: Box :: new( |meter| {
294294 let attrs = vec![
295- Key :: new( "A" ) . string ( "B" ) ,
296- Key :: new( "C" ) . string ( "D" ) ,
297- Key :: new( "E" ) . bool ( true ) ,
298- Key :: new( "F" ) . i64 ( 42 ) ,
295+ KeyValue :: new( "A" , "B" ) ,
296+ KeyValue :: new( "C" , "D" ) ,
297+ KeyValue :: new( "E" , true ) ,
298+ KeyValue :: new( "F" , 42 ) ,
299299 ] ;
300300 let counter = meter
301301 . f64_counter( "foo" )
@@ -313,7 +313,7 @@ fn prometheus_exporter_integration() {
313313 builder: ExporterBuilder :: default ( ) . with_resource_selector( ResourceSelector :: All ) ,
314314 expected_file: "resource_in_every_metrics.txt" ,
315315 record_metrics: Box :: new( |meter| {
316- let attrs = vec![ Key :: new( "A" ) . string ( "B" ) , Key :: new( "C" ) . string ( "D" ) ] ;
316+ let attrs = vec![ KeyValue :: new( "A" , "B" ) , KeyValue :: new( "C" , "D" ) ] ;
317317 let gauge = meter
318318 . i64_up_down_counter( "bar" )
319319 . with_description( "a fun little gauge" )
@@ -330,7 +330,7 @@ fn prometheus_exporter_integration() {
330330 . with_resource_selector( HashSet :: from( [ Key :: new( "service.name" ) ] ) ) ,
331331 expected_file: "select_resource_in_every_metrics.txt" ,
332332 record_metrics: Box :: new( |meter| {
333- let attrs = vec![ Key :: new( "A" ) . string ( "B" ) , Key :: new( "C" ) . string ( "D" ) ] ;
333+ let attrs = vec![ KeyValue :: new( "A" , "B" ) , KeyValue :: new( "C" , "D" ) ] ;
334334 let gauge = meter
335335 . i64_up_down_counter( "bar" )
336336 . with_description( "a fun little gauge" )
0 commit comments