Tracing Lettuce, Command Duration - What does it really measure? #2981
-
I didn't find any reference explaining exactly what the duration specified in the trace, really indicates. I'm trying to analyze some slow http requests, and I see some MGET redis requests taking even 750 ms to run. But what this duration includes? This is what I suppose it includes:
I'm not sure about the last one. But what I like to know is, if I can exclude at least latencies coming from the app. So I can be sure the app is not the problem. Otherwise the trace is not helping much. Too many variables to consider. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hope this late answer will help. There are quite some unknowns about your deployment for me to answer with confidence. Each of these public class CommandHandler extends ChannelDuplexHandler implements HasQueuedCommands {
...
private void attachTracing(ChannelHandlerContext ctx, RedisCommand<?, ?, ?> command) {
... ... and then ends when the response is received by the driver ... public class BraveTracing implements Tracing {
...
@Override
public BraveSpan start(RedisCommand<?, ?, ?> command) {
span.name(command.getType().toString());
...
if (command instanceof CompleteableCommand) {
...
span.finish();
});
} else {
throw new IllegalArgumentException("Command " + command
+ " must implement CompleteableCommand to attach Span completion to command completion");
}
span.start();
this.tracingOptions.customizeSpan(command, span);
return this;
}
... ... depending on the type of the command and the settings for tracing. On your questions, specifically:
Not sure of your architecture. Assuming the client is where the Lettuce driver is used and the server is where the Redis server is deployed, then yes.
Probably not.
Probably yes. Lettuce makes RESP (RESP2 or RESP3) requests to Redis servers. The calculated time includes the time needed for the Redis server to process and respond to the MGET command. Querying other databases is not calculated. Only the time that was spend getting a response from Redis.
If the application uses Lettuce to handle the request, then yes. Does that help? |
Beta Was this translation helpful? Give feedback.
Hope this late answer will help.
There are quite some unknowns about your deployment for me to answer with confidence. Each of these
span
reports trace the execution of a single command. It starts the trace when the command is issued... and then ends when the response is received by the driver ...