-
Notifications
You must be signed in to change notification settings - Fork 534
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
feat(instrumentation-redis): add support for redis@^4.0.0 #982
Conversation
Codecov Report
@@ Coverage Diff @@
## main #982 +/- ##
==========================================
- Coverage 95.91% 93.46% -2.45%
==========================================
Files 13 18 +5
Lines 856 1179 +323
Branches 178 236 +58
==========================================
+ Hits 821 1102 +281
- Misses 35 77 +42
|
If the implementation doesn't share a lot of code I'd split it into a totally separate package. Do you know of any drawbacks that approach might have? |
I support this too. The drawbacks I can spot:
Benefits:
What do you think a name for a package such as this should be? |
Naming things - the hardest part. I don't have a strong preference. If had to come up with good heuristics on this, those would be:
Based on that, I'd leave |
Like, I'll update the PR to express that. |
Done. There are now 2 packages: |
plugins/node/opentelemetry-instrumentation-redis-4/package.json
Outdated
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍 Sorry for taking so long to review.
Check the test failures in CI. Other than that. LGTM.
plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
redis package released version This currently breaks the tests (and support) for this new version. |
@habmic @rauno56 @dyladan I udpate the PR accordingly and now test-all-versions is green again for all versions on my local setup (node 16) and CI is green for the latests version (4.1.0) except for node 12. For node 12 it seems to fail because of an issue with redis package itself, documented here, here and here. The package itself does not publish the supported node version anywhere in a clear way, but I found this text in the changelog of the relevant subpackage of the latest version:
I am going to remove the tests for redis 4 for node 12 |
CI is now green. |
@blumamir, feel free to resolve the conflicts and merge right away. |
Which problem is this PR solving?
Short description of the changes
The new version splits the functionality into sub-packages.
I added patches for the relevant function in the subpackage:
@node-redis/client
:extendWithCommands
, to allow access toexecutor
which is the function that records spans upon command executionRedisClientMultiCommand.exec
function to correctly handle transactions andMULTI
commands.RedisClient.multi
function to allow setting the client options on the multi command object to allow recording network attributes for transactions.I added support for all existing config options.
Added tests for v4 + added it to test all versions and made sure it's green
Since v4 supports node >= 12, the package.json and CI actions were updated accordingly. This might be breaking for users of redis 2-3 with node < 12.
Checklist
npm run test-all-versions
for the edited package(s) on the latest commit if applicable.