Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redis client only instrumentation #3143

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

OlegZv
Copy link

@OlegZv OlegZv commented Dec 22, 2024

Description

This PR allows instrumenting only a specific Redis client instead of the whole class (and all clients).
Changes:

  • Ability to instrument a specific Redis client with instrument_client (supports any of the existing clients such as async/cluster)
  • Added more typing for instrument and the newly added instrument_client methods (still allows **kwargs). It makes the docs easier to read/understand.
  • Moved some version "if" condition checks to global "defines" to make the code more readable.
  • Added a Redis sphinx reference so the docs can correctly link up with Redis clients.
  • Updated the docs for a more consistent structure (add specific sections).
    image

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update (updated)

How Has This Been Tested?

Ran the already included tests with python3.12 and python3.11 and redis 5.0.1. Added more tests to ensure that only the client we instrumented produces spans. I ran tox tests, ruff, linting, formatting, etc. (everything in the contributing guide).

Tested documentation changes with tox -e docs to ensure everything builds correctly and looks good.
Also, I ran tests with coverage: original coverage was 77%. Now it's 80%:
image
Note: I plan to add another PR for the FT-related commands later. (there's currently a bug in some span param parsing functions)

Does This PR Require a Core Repo Change?

  • No.

Checklist:

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

  • Followed the style guidelines of this project
  • Changelogs have been updated (will update after opening this PR)
  • Unit tests have been added
  • Documentation has been updated

@OlegZv OlegZv requested a review from a team as a code owner December 22, 2024 05:37
Copy link

linux-foundation-easycla bot commented Dec 22, 2024

CLA Not Signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants