@@ -123,7 +123,7 @@ func TestMinMaxSumCountValue(t *testing.T) {
123
123
124
124
func TestMinMaxSumCountDatapoints (t * testing.T ) {
125
125
desc := metric .NewDescriptor ("" , metric .ValueRecorderInstrumentKind , number .Int64Kind )
126
- labels := attribute .NewSet ()
126
+ labels := attribute .NewSet (attribute . String ( "one" , "1" ) )
127
127
mmsc , ckpt := metrictest .Unslice2 (minmaxsumcount .New (2 , & desc ))
128
128
129
129
assert .NoError (t , mmsc .Update (context .Background (), 1 , & desc ))
@@ -137,6 +137,12 @@ func TestMinMaxSumCountDatapoints(t *testing.T) {
137
137
BucketCounts : []uint64 {1 , 10 },
138
138
StartTimeUnixNano : uint64 (intervalStart .UnixNano ()),
139
139
TimeUnixNano : uint64 (intervalEnd .UnixNano ()),
140
+ Labels : []* commonpb.StringKeyValue {
141
+ {
142
+ Key : "one" ,
143
+ Value : "1" ,
144
+ },
145
+ },
140
146
},
141
147
}
142
148
record := export .NewRecord (& desc , & labels , nil , ckpt .Aggregation (), intervalStart , intervalEnd )
@@ -162,7 +168,7 @@ func TestMinMaxSumCountPropagatesErrors(t *testing.T) {
162
168
163
169
func TestSumIntDataPoints (t * testing.T ) {
164
170
desc := metric .NewDescriptor ("" , metric .ValueRecorderInstrumentKind , number .Int64Kind )
165
- labels := attribute .NewSet ()
171
+ labels := attribute .NewSet (attribute . String ( "one" , "1" ) )
166
172
s , ckpt := metrictest .Unslice2 (sumAgg .New (2 ))
167
173
assert .NoError (t , s .Update (context .Background (), number .Number (1 ), & desc ))
168
174
require .NoError (t , s .SynchronizedMove (ckpt , & desc ))
@@ -182,6 +188,12 @@ func TestSumIntDataPoints(t *testing.T) {
182
188
Value : 1 ,
183
189
StartTimeUnixNano : uint64 (intervalStart .UnixNano ()),
184
190
TimeUnixNano : uint64 (intervalEnd .UnixNano ()),
191
+ Labels : []* commonpb.StringKeyValue {
192
+ {
193
+ Key : "one" ,
194
+ Value : "1" ,
195
+ },
196
+ },
185
197
}}}, m .GetIntSum ())
186
198
assert .Nil (t , m .GetDoubleGauge ())
187
199
assert .Nil (t , m .GetDoubleHistogram ())
@@ -190,7 +202,7 @@ func TestSumIntDataPoints(t *testing.T) {
190
202
191
203
func TestSumFloatDataPoints (t * testing.T ) {
192
204
desc := metric .NewDescriptor ("" , metric .ValueRecorderInstrumentKind , number .Float64Kind )
193
- labels := attribute .NewSet ()
205
+ labels := attribute .NewSet (attribute . String ( "one" , "1" ) )
194
206
s , ckpt := metrictest .Unslice2 (sumAgg .New (2 ))
195
207
assert .NoError (t , s .Update (context .Background (), number .NewFloat64Number (1 ), & desc ))
196
208
require .NoError (t , s .SynchronizedMove (ckpt , & desc ))
@@ -213,13 +225,19 @@ func TestSumFloatDataPoints(t *testing.T) {
213
225
Value : 1 ,
214
226
StartTimeUnixNano : uint64 (intervalStart .UnixNano ()),
215
227
TimeUnixNano : uint64 (intervalEnd .UnixNano ()),
228
+ Labels : []* commonpb.StringKeyValue {
229
+ {
230
+ Key : "one" ,
231
+ Value : "1" ,
232
+ },
233
+ },
216
234
}}}, m .GetDoubleSum ())
217
235
}
218
236
}
219
237
220
238
func TestLastValueIntDataPoints (t * testing.T ) {
221
239
desc := metric .NewDescriptor ("" , metric .ValueRecorderInstrumentKind , number .Int64Kind )
222
- labels := attribute .NewSet ()
240
+ labels := attribute .NewSet (attribute . String ( "one" , "1" ) )
223
241
s , ckpt := metrictest .Unslice2 (lvAgg .New (2 ))
224
242
assert .NoError (t , s .Update (context .Background (), number .Number (100 ), & desc ))
225
243
require .NoError (t , s .SynchronizedMove (ckpt , & desc ))
@@ -234,6 +252,12 @@ func TestLastValueIntDataPoints(t *testing.T) {
234
252
Value : 100 ,
235
253
StartTimeUnixNano : 0 ,
236
254
TimeUnixNano : uint64 (timestamp .UnixNano ()),
255
+ Labels : []* commonpb.StringKeyValue {
256
+ {
257
+ Key : "one" ,
258
+ Value : "1" ,
259
+ },
260
+ },
237
261
}}, m .GetIntGauge ().DataPoints )
238
262
assert .Nil (t , m .GetIntHistogram ())
239
263
assert .Nil (t , m .GetIntSum ())
@@ -245,7 +269,7 @@ func TestLastValueIntDataPoints(t *testing.T) {
245
269
246
270
func TestExactIntDataPoints (t * testing.T ) {
247
271
desc := metric .NewDescriptor ("" , metric .ValueRecorderInstrumentKind , number .Int64Kind )
248
- labels := attribute .NewSet ()
272
+ labels := attribute .NewSet (attribute . String ( "one" , "1" ) )
249
273
e , ckpt := metrictest .Unslice2 (arrAgg .New (2 ))
250
274
assert .NoError (t , e .Update (context .Background (), number .Number (100 ), & desc ))
251
275
require .NoError (t , e .SynchronizedMove (ckpt , & desc ))
@@ -260,6 +284,12 @@ func TestExactIntDataPoints(t *testing.T) {
260
284
Value : 100 ,
261
285
StartTimeUnixNano : toNanos (intervalStart ),
262
286
TimeUnixNano : toNanos (intervalEnd ),
287
+ Labels : []* commonpb.StringKeyValue {
288
+ {
289
+ Key : "one" ,
290
+ Value : "1" ,
291
+ },
292
+ },
263
293
}}, m .GetIntGauge ().DataPoints )
264
294
assert .Nil (t , m .GetIntHistogram ())
265
295
assert .Nil (t , m .GetIntSum ())
@@ -271,7 +301,7 @@ func TestExactIntDataPoints(t *testing.T) {
271
301
272
302
func TestExactFloatDataPoints (t * testing.T ) {
273
303
desc := metric .NewDescriptor ("" , metric .ValueRecorderInstrumentKind , number .Float64Kind )
274
- labels := attribute .NewSet ()
304
+ labels := attribute .NewSet (attribute . String ( "one" , "1" ) )
275
305
e , ckpt := metrictest .Unslice2 (arrAgg .New (2 ))
276
306
assert .NoError (t , e .Update (context .Background (), number .NewFloat64Number (100 ), & desc ))
277
307
require .NoError (t , e .SynchronizedMove (ckpt , & desc ))
@@ -286,6 +316,12 @@ func TestExactFloatDataPoints(t *testing.T) {
286
316
Value : 100 ,
287
317
StartTimeUnixNano : toNanos (intervalStart ),
288
318
TimeUnixNano : toNanos (intervalEnd ),
319
+ Labels : []* commonpb.StringKeyValue {
320
+ {
321
+ Key : "one" ,
322
+ Value : "1" ,
323
+ },
324
+ },
289
325
}}, m .GetDoubleGauge ().DataPoints )
290
326
assert .Nil (t , m .GetIntHistogram ())
291
327
assert .Nil (t , m .GetIntSum ())
0 commit comments