opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Fix missing attributes in RedisCluster spans

Open a-cid opened this issue 1 year ago • 4 comments
trafficstars

Description

Modifies _set_connection_attributes to handle conn being an instance of redis.cluster.RedisCluster.

Fixes #2505

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • [x] Unit test.

Does This PR Require a Core Repo Change?

  • [x] No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • [ ] Followed the style guidelines of this project
  • [ ] Changelogs have been updated
  • [ ] Unit tests have been added
  • [ ] Documentation has been updated

a-cid avatar Jun 20 '24 14:06 a-cid

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: a-cid / name: Auster Cid (f3024bc4646c7f6f3d76391bc81d2b2b5e5c5d98, 65e2c6453b423e300c23dc500c4a07956bb9e4f7, 7802ade65dbc044dbe52663214e66a54d9bee4e1, 8ff71aa4f71d3eb6637071e8dc72d7de37ea1b90, 0c97cdf10a8b3487a81bd5d477b955369e9ffc92, a0f908aaea6b3216a4609f5c50b6522379bfe563, f5c4bf4503933e5fbd62b6d59c66a56de243a592, 848cc51986a7a5c29a70e95f06a9e1d7d6ca7c66, ac8cc13b7200e9d7896c47f5c0155222a18d389e)
  • :white_check_mark: login: xrmx / name: Riccardo Magliocchetti (045c9c6692b2a682f39f566330b2f2aa18d0f9e9, 5e71011332d651104eff37fc47c5bd6f7a67c2ce)

@xrmx

I've added the requested test

Have to admit that mocking RedisCluster was a challenge. Full disclosure, I ended up copying some code from https://github.com/redis/redis-py/blob/master/tests/test_cluster.py Hope that's not a problem.

a-cid avatar Jun 21 '24 20:06 a-cid

@a-cid please take a look at failing docker tests

xrmx avatar Jun 24 '24 16:06 xrmx

@xrmx

Fixed

a-cid avatar Jun 26 '24 04:06 a-cid