@@ -283,7 +283,7 @@ func optionFromLabels(labelKeys []string, optionalLabelKeys []string, optionalLa
283
283
}
284
284
}
285
285
}
286
- return otelmetric .WithAttributes ( attributes ... )
286
+ return otelmetric .WithAttributeSet ( otelattribute . NewSet ( attributes ... ) )
287
287
}
288
288
289
289
// registryMetrics implements MetricsRecorder for the client and server stats
@@ -330,41 +330,40 @@ func (rm *registryMetrics) registerMetrics(metrics *estats.Metrics, meter otelme
330
330
331
331
func (rm * registryMetrics ) RecordInt64Count (handle * estats.Int64CountHandle , incr int64 , labels ... string ) {
332
332
desc := handle .Descriptor ()
333
- ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
334
-
335
333
if ic , ok := rm .intCounts [desc ]; ok {
334
+ ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
336
335
ic .Add (context .TODO (), incr , ao )
337
336
}
338
337
}
339
338
340
339
func (rm * registryMetrics ) RecordFloat64Count (handle * estats.Float64CountHandle , incr float64 , labels ... string ) {
341
340
desc := handle .Descriptor ()
342
- ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
343
341
if fc , ok := rm .floatCounts [desc ]; ok {
342
+ ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
344
343
fc .Add (context .TODO (), incr , ao )
345
344
}
346
345
}
347
346
348
347
func (rm * registryMetrics ) RecordInt64Histo (handle * estats.Int64HistoHandle , incr int64 , labels ... string ) {
349
348
desc := handle .Descriptor ()
350
- ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
351
349
if ih , ok := rm .intHistos [desc ]; ok {
350
+ ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
352
351
ih .Record (context .TODO (), incr , ao )
353
352
}
354
353
}
355
354
356
355
func (rm * registryMetrics ) RecordFloat64Histo (handle * estats.Float64HistoHandle , incr float64 , labels ... string ) {
357
356
desc := handle .Descriptor ()
358
- ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
359
357
if fh , ok := rm .floatHistos [desc ]; ok {
358
+ ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
360
359
fh .Record (context .TODO (), incr , ao )
361
360
}
362
361
}
363
362
364
363
func (rm * registryMetrics ) RecordInt64Gauge (handle * estats.Int64GaugeHandle , incr int64 , labels ... string ) {
365
364
desc := handle .Descriptor ()
366
- ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
367
365
if ig , ok := rm .intGauges [desc ]; ok {
366
+ ao := optionFromLabels (desc .Labels , desc .OptionalLabels , rm .optionalLabels , labels ... )
368
367
ig .Record (context .TODO (), incr , ao )
369
368
}
370
369
}
0 commit comments