Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(redisotel): fix buggy append in reportPoolStats
The current append twice to `conf.attrs` approach in `reportPoolStats` may result in unexpected idleAttrs, due to `append` [can mutate](golang/go#29115 (comment)) 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/[email protected]#WithAttributes>.
- Loading branch information