@@ -34,11 +34,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
34
34
// Record measurements using the Counter instrument.
35
35
counter. add (
36
36
10 ,
37
- [
37
+ & [
38
38
KeyValue :: new ( "mykey1" , "myvalue1" ) ,
39
39
KeyValue :: new ( "mykey2" , "myvalue2" ) ,
40
- ]
41
- . as_ref ( ) ,
40
+ ] ,
42
41
) ;
43
42
44
43
// Create a ObservableCounter instrument and register a callback that reports the measurement.
@@ -52,11 +51,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
52
51
observer. observe_u64 (
53
52
& observable_counter,
54
53
100 ,
55
- [
54
+ & [
56
55
KeyValue :: new ( "mykey1" , "myvalue1" ) ,
57
56
KeyValue :: new ( "mykey2" , "myvalue2" ) ,
58
- ]
59
- . as_ref ( ) ,
57
+ ] ,
60
58
)
61
59
} ) ?;
62
60
@@ -66,11 +64,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
66
64
// Record measurements using the UpCounter instrument.
67
65
updown_counter. add (
68
66
-10 ,
69
- [
67
+ & [
70
68
KeyValue :: new ( "mykey1" , "myvalue1" ) ,
71
69
KeyValue :: new ( "mykey2" , "myvalue2" ) ,
72
- ]
73
- . as_ref ( ) ,
70
+ ] ,
74
71
) ;
75
72
76
73
// Create a Observable UpDownCounter instrument and register a callback that reports the measurement.
@@ -84,11 +81,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
84
81
observer. observe_i64 (
85
82
& observable_up_down_counter,
86
83
100 ,
87
- [
84
+ & [
88
85
KeyValue :: new ( "mykey1" , "myvalue1" ) ,
89
86
KeyValue :: new ( "mykey2" , "myvalue2" ) ,
90
- ]
91
- . as_ref ( ) ,
87
+ ] ,
92
88
)
93
89
} ) ?;
94
90
@@ -101,11 +97,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
101
97
// Record measurements using the histogram instrument.
102
98
histogram. record (
103
99
10.5 ,
104
- [
100
+ & [
105
101
KeyValue :: new ( "mykey1" , "myvalue1" ) ,
106
102
KeyValue :: new ( "mykey2" , "myvalue2" ) ,
107
- ]
108
- . as_ref ( ) ,
103
+ ] ,
109
104
) ;
110
105
111
106
// Note that there is no ObservableHistogram instrument.
@@ -122,11 +117,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
122
117
123
118
gauge. record (
124
119
1.0 ,
125
- [
120
+ & [
126
121
KeyValue :: new ( "mykey1" , "myvalue1" ) ,
127
122
KeyValue :: new ( "mykey2" , "myvalue2" ) ,
128
- ]
129
- . as_ref ( ) ,
123
+ ] ,
130
124
) ;
131
125
}
132
126
@@ -142,11 +136,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
142
136
observer. observe_f64 (
143
137
& observable_gauge,
144
138
1.0 ,
145
- [
139
+ & [
146
140
KeyValue :: new ( "mykey1" , "myvalue1" ) ,
147
141
KeyValue :: new ( "mykey2" , "myvalue2" ) ,
148
- ]
149
- . as_ref ( ) ,
142
+ ] ,
150
143
)
151
144
} ) ?;
152
145
0 commit comments