Cattī Crūdēlēs
|
4767d9dfaf
|
fix(redisotel): fix buggy append in reportPoolStats (#3122)
The current append twice to `conf.attrs` approach in `reportPoolStats` may result in unexpected idleAttrs,
due to `append` [can mutate](https://github.com/golang/go/issues/29115#issuecomment-444669036) the underlying array of the original slice,
as demonstrated at <https://go.dev/play/p/jwRMofH91eQ?v=goprev>.
Also, I replaced `metric.WithAttributes` in `reportPoolStats` with `metric.WithAttributeSet`,
since `WithAttributes` is just `WithAttributeSet` with some extra works that are not needed here,
see <https://pkg.go.dev/go.opentelemetry.io/otel/metric@v1.22.0#WithAttributes>.
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
|
2025-08-05 15:15:34 +03:00 |
|