Skip to content

[Bug]When tracing a pipeline, the recorded results are inaccurate #352

@wanghonglu

Description

@wanghonglu

Fred version - 10.1.0
Redis version - 7.0.15
Platform - linux|mac|windows
Deployment type - cluster|sentinel|centralized

when run code like this

    let pip = redis_client.pipeline();
    pip.get::<(), _>("tracing_redis_key").await.unwrap();
    pip.del::<(), _>("tracing_redis_key").await.unwrap();
    let (value, _): (i32, ()) = pip.all().await.unwrap();

In this case, only pip.all will actually interact with the network and send the command to the server. However, the current code records tracing by opening a span for each get/set. However, the get/set here is actually just assembling commands in memory, which takes a very short time. It will be inaccurate, and the all operation does not record span.
Looking at it on Jaeger, it looks like this
Image
I think we should add a separate span of pipelinecmds, and the name can be attached to all the sub-commands,such as cmd.name=GET,DEL but when I look at the code, it seems that a lot of code needs to be changed if this is to be done.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions