@@ -327,7 +327,7 @@ func (inst *Observer) ObserveFloat64(ctx context.Context, num float64, cfg OpCon
327327}
328328
329329// Observe performs a generic update for any synchronous instrument.
330- func Observe [N number.Any , Traits number.Traits [N ]](_ context.Context , inst * Observer , num N , cfg OpConfig ) {
330+ func Observe [N number.Any , Traits number.Traits [N ]](ctx context.Context , inst * Observer , num N , cfg OpConfig ) {
331331 if inst == nil {
332332 // Instrument was completely disabled by the view.
333333 return
@@ -339,15 +339,20 @@ func Observe[N number.Any, Traits number.Traits[N]](_ context.Context, inst *Obs
339339 return
340340 }
341341
342- var rec * recordKV
342+ var keyValues []attribute. KeyValue
343343 if cfg .KeyValues != nil {
344- rec = acquireUninitializedKV [ N ]( inst , cfg .KeyValues )
344+ keyValues = cfg .KeyValues
345345 } else {
346346 // TODO: This is a new code path for optimization,
347347 // for now fall back to the slow path.
348- rec = acquireUninitializedKV [ N ]( inst , cfg .Attributes .ToSlice () )
348+ keyValues = cfg .Attributes .ToSlice ()
349349 }
350350
351+ if inst .performance .MeasurementProcessor != nil {
352+ keyValues = inst .performance .MeasurementProcessor .Process (ctx , keyValues )
353+ }
354+ rec := acquireUninitializedKV [N ](inst , keyValues )
355+
351356 defer rec .refMapped .unref ()
352357
353358 rec .readAccumulator ().(viewstate.Updater [N ]).Update (num )
0 commit comments