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
finagle-redis: Add the RedisTracingFilter and RedisLoggingFilter back into the default Redis Stack #866
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #866 +/- ##
===========================================
+ Coverage 78.19% 78.20% +0.01%
===========================================
Files 829 829
Lines 24452 24468 +16
Branches 1580 1584 +4
===========================================
+ Hits 19120 19135 +15
- Misses 5332 5333 +1
Continue to review full report at Codecov.
|
Realized I pushed with an old work account which is why the CLA wasn't showing up as signed. Fixed by pushing the same commit over the original one but associated with the correct email. |
if (statsParam.statsReceiver.isNull) | ||
next | ||
else | ||
new RedisLoggingFilter(statsParam.statsReceiver.scope("http")).andThen(next) |
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.
I suspect the scope isn't really supposed to be "http"
.
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.
Ah yes this looks copy-paste on my part, the original commit does not seem to add a scope. I can remove it. Alternatively some modules seem to scope the receiver to the protocol name like http
so I could change it to that if it makes sense.
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.
I suspect we want to follow what was originally there. It would normally be the job of whoever passes the stats receiver to us to define the scope, and if we need to go deeper this module would be in charge of naming that scope and passing it on.
@@ -72,6 +73,8 @@ object Redis extends Client[Command, Reply] with RedisRichClient { | |||
private val stack: Stack[ServiceFactory[Command, Reply]] = StackClient.newStack | |||
.insertBefore(DefaultPool.Role, RedisPool.module) | |||
.insertAfter(StackClient.Role.prepConn, ConnectionInitCommand.module) | |||
.replace(StackClient.Role.protoTracing, RedisTracingFilter.module) | |||
.insertAfter(RedisLoggingFilter.role, RedisLoggingFilter.module) |
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.
Does the RedisLoggingFilter.role
exist in the client stack already? I believe using insertAfter
here will not put it into the stack, since the role doesn't exists. Maybe before the tracing filter?
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.
Ah yes, the role does not currently exist in the stack. Docs from insertAfter
say: If no elements match the role, then an unmodified stack is returned.
So looks like this is currently won't add the logging filter. I'll change it to insert before the tracing filter.
Hi @rpless ,
@enbnt has tried to do a merge on Github but the error persists. Would you please do a rebase then I can try to pull it again? Thank you! |
bbfc453
to
d45d770
Compare
Hi @jyanJing I believe that happens because one of the commits in this PR conflicts with this commit in develop. I have rebased this Pull Request against |
Hi @rpless, Thank you for rebasing the branch! I am able to pull it in and get the team's review. Since this change is made to the stack module with the tracing and logging filter, we are very careful with changes in that area because it might bring up latencies for services that use finagle-redis. So I am working with 2 other teams to canary the change now, to make sure we capture any behavior changes. It is not about your change, it is a critical area to be precautious about. I wanted to let you know that it will take longer to merge this change, but I am actively working on it! Really appreciate for making this change! Best regards, |
Thanks for setting up the canary to test the change @jyanJing! |
Problem
I was experimenting with the Tracing module and instrumented a Redis Client. I noticed that Redis rpc calls did not get named unlike the Http calls that were being traced. After some discussion on gitter, @mosesn pointed out that a commit where the
RedisLoggingFilter
andRedisTracingFilter
had been ported during the move from Netty 3 -> Netty 4, but had not been added back to the stack.Solution
I added the
RedisLoggingFilter
and theRedisTracingFilter
to the default client stack.Result
This will add stats and tracing back to the Redis Client by default.
I followed the mysql client for adding the
role
andmodule
definitions. If there as a better way to do this let me know and I can change it.