feat: added support for redis v6#2578
Open
instanacd wants to merge 8 commits into
Open
Conversation
aryamohanan
reviewed
Jun 4, 2026
| // RedisClient exists in both v3 and v6. Detect the legacy v3 API via | ||
| // the combined presence of RedisClient and Multi rather than RedisClient alone. | ||
| const isLegacyRedisAPI = | ||
| redis.RedisClient?.prototype && typeof redis.Multi?.prototype?.exec_transaction === 'function'; |
Contributor
There was a problem hiding this comment.
RedisClient alone cannot be used to distinguish v3 from newer v6 because it is present in both v3 and v6.
Replaced the RedisClient-only detection with a check for the legacy class-based API shape.
Detect the legacy implementation via the combined presence of:
- RedisClient
- Multi
Continue using prototype instrumentation only for v3. Use the createClient-based instrumentation for v4+.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Added support for Redis v6.
https://github.com/redis/node-redis/releases/tag/redis%406.0.0
Changes
Based on the Redis 6.0 release notes, Redis v6 introduces the following changes that affect our instrumentation:
RedisClient,RedisCluster,RedisSentinel, and pool-related classes.Instrumentation Changes
Previously, the instrumentation used the presence of
RedisClientto determine whether to apply legacy prototype-based instrumentation. This assumption is no longer valid because:As Redis v6 reintroduces the
RedisClientexport, checking forRedisClientalone incorrectly classifies v6 as a legacy client. Detect the legacy implementation via the combined presence of:This uniquely identifies the Redis v3 API shape while ensuring Redis v4–v6 continue to use the modern factory-based instrumentation path.
Reference