Skip to content

Commit 7c4b924

Browse files
authored
fix(redisotel): correct metrics.DialHook attrs (#2331)
1 parent f70c952 commit 7c4b924

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

extra/redisotel/metrics.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ func (mh *metricsHook) DialHook(hook redis.DialHook) redis.DialHook {
193193

194194
conn, err := hook(ctx, network, addr)
195195

196-
mh.createTime.Record(ctx, milliseconds(time.Since(start)), mh.attrs...)
196+
attrs := make([]attribute.KeyValue, 0, len(mh.attrs)+1)
197+
attrs = append(attrs, mh.attrs...)
198+
attrs = append(attrs, statusAttr(err))
199+
200+
mh.createTime.Record(ctx, milliseconds(time.Since(start)), attrs...)
197201
return conn, err
198202
}
199203
}

0 commit comments

Comments
 (0)