fix(redis): extract ClusterPipeline commands from _execution_strategy in redis-py 6+#4436
Open
alliasgher wants to merge 2 commits intoopen-telemetry:mainfrom
Open
fix(redis): extract ClusterPipeline commands from _execution_strategy in redis-py 6+#4436alliasgher wants to merge 2 commits intoopen-telemetry:mainfrom
alliasgher wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
… in redis-py 6+ redis-py 6 refactored ClusterPipeline so that commands are appended to _execution_strategy.command_queue instead of instance.command_stack. The latter still exists but is never populated, causing pipeline spans to always show an empty command list. Prefer _execution_strategy.command_queue when it exists, falling back to the old command_stack / _command_stack attributes for older versions and non-cluster pipelines. Fixes open-telemetry#4084 Signed-off-by: alliasgher <alliasgher123@gmail.com>
9a5e669 to
ce7ee4f
Compare
Signed-off-by: Ali <alliasgher123@gmail.com>
MikeGoldsmith
approved these changes
Apr 15, 2026
Member
MikeGoldsmith
left a comment
There was a problem hiding this comment.
Looks good - thanks @alliasgher.
Worth noting #3478 is also modifying this func, so we need to be aware whichever comes second will have a conflict to resolve.
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.
Description
In redis-py 6+,
ClusterPipelinemoved its pending command list from a direct attribute to an internal_execution_strategyobject. The instrumentation still read the old attribute path and therefore saw an empty command list, so span attributes for pipelined cluster commands were blank.Extract the command list from
_execution_strategywhen present so the span attributes reflect the actual pipelined commands.Fixes #4420
Type of change
Checklist
Unreleased / Fixed