ioredis: two spans are generated for operations in offline queue #288
Labels
bug
Something isn't working
never-stale
priority:p3
Bugs which cause problems in user apps not related to correctness (performance, memory use, etc)
What version of OpenTelemetry are you using?
v0.13.0
What version of Node are you using?
12
What did you do?
If possible, provide a recipe for reproducing the error.
What did you expect to see?
As I am calling
set
function once, so I expect to see a single span\trace with ioredisset
operation.What did you see instead?
Two different spans in two different traces with ioredis
set
operation.Additional context
This happens because of ioredis offline queue.
The call to
set
creates a call tosendCommand
which create the first span, but does not send it as redis status is not ready yet, it is instead being pushed to the offline queue.When ioredis connect to redis, it calls
sendCommand
again from the offline queue which generate a second span for the same operation.This can confuse the user, giving the impression that
set
(or any other operation) was called more times, and in a different context from what the instrumented code was actually calling.The text was updated successfully, but these errors were encountered: