File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,22 +334,24 @@ func (i *integrationStats) statsDecorator(delegate AddFn) AddFn {
334334 idx , err := f ()
335335 attr := []attribute.KeyValue {}
336336 if err != nil {
337- if err == ErrPushback {
338- attr = append (attr , attribute .Bool ("tessera.pushback" , true ))
339- } else {
337+ if err != ErrPushback {
340338 // Just flag that it's an errored request to avoid high cardinality of attribute values.
341339 // TODO(al): We might want to bucket errors into OTel status codes in the future, though.
342340 attr = append (attr , attribute .String ("tessera.error.type" , "_OTHER" ))
343341 }
344342 }
345- if idx .IsDup {
346- attr = append (attr , attribute .Bool ("tessera.duplicate" , true ))
347- } else {
348- i .sample (idx .Index )
349- }
343+
344+ attr = append (attr , attribute .Bool ("tessera.pushback" , err == ErrPushback ))
345+ attr = append (attr , attribute .Bool ("tessera.duplicate" , idx .IsDup ))
346+
350347 appenderAddsTotal .Add (ctx , 1 , metric .WithAttributes (attr ... ))
351348 d := time .Since (start )
352349 appenderAddHistogram .Record (ctx , d .Milliseconds (), metric .WithAttributes (attr ... ))
350+
351+ if ! idx .IsDup {
352+ i .sample (idx .Index )
353+ }
354+
353355 return idx , err
354356 }
355357 }
You can’t perform that action at this time.
0 commit comments