Skip to content

Commit ad376bf

Browse files
authored
Remove metrics with empty data
Because empty data cannot be considered an error.
1 parent eeea45c commit ad376bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extra/redisotel/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func milliseconds(d time.Duration) float64 {
329329
}
330330

331331
func statusAttr(err error) attribute.KeyValue {
332-
if err != nil {
332+
if err != nil && err != redis.Nil {
333333
return attribute.String("status", "error")
334334
}
335335
return attribute.String("status", "ok")

0 commit comments

Comments
 (0)