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 22 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 Signed

The committers listed above are authorized under a signed CLA.

@xrmx
Copy link
Contributor

xrmx commented Dec 23, 2024

@OlegZv we can only accept contributions covered by the CLA, please sign it.

@OlegZv
Copy link
Author

OlegZv commented Dec 23, 2024

@OlegZv we can only accept contributions covered by the CLA, please sign it.

Of course! I have already received a pre-approval for this contribution. Pending is the CLA review. Hopefully, I'll get a response soon. Can we still proceed to review these changes so I can work on any comments/change requests in the meantime?

@OlegZv
Copy link
Author

OlegZv commented Feb 4, 2025

@xrmx, the CLA is finally good to go!

@OlegZv
Copy link
Author

OlegZv commented Feb 27, 2025

Looking for another round of tests and approval, please! @xrmx @emdneto @lzchen

@OlegZv
Copy link
Author

OlegZv commented Feb 28, 2025

Yay! Thank you! How does one get an approval for the PR? Is there something this PR is missing?

@OlegZv
Copy link
Author

OlegZv commented Mar 4, 2025

I think I'll wait for the approval before doing "Update branch".

@OlegZv
Copy link
Author

OlegZv commented Mar 5, 2025

Hello @xrmx! Thanks again for the review. Are my responses satisfactory or do you want me to address anything else?

@OlegZv
Copy link
Author

OlegZv commented Mar 12, 2025

Hello all! Is this PR missing anything needed for approval?

@OlegZv OlegZv requested review from xrmx, lzchen and emdneto March 12, 2025 23:17
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.

5 participants