Redis client interceptor does not intercept pipelined commands
I noticed that pipelined calls (including MULTI with a block) do not show up in the performance bar. They also don't get added to the redis_*
numbers in our logs.
Looking at the code, we intercept the #call
method here: https://gitlab.com/gitlab-org/gitlab/-/blob/dd1e70d3676891025534dc4a1e89ca9383178fe7/lib/gitlab/instrumentation/redis_interceptor.rb#L16.
It looks like these go through #call_pipeline
instead of #call
:
- https://github.com/redis/redis-rb/blob/674541c5cc162b46066556811967a28a184f4665/lib/redis.rb#L176
- https://github.com/redis/redis-rb/blob/cc21d6762a63737969aa01139bb071da1f710b74/lib/redis/commands/transactions.rb#L46
This can result to under reporting of Redis call counts and durations.
Edited by Heinrich Lee Yu