Skip to content

Conversation

aryamohanan
Copy link
Contributor

@aryamohanan aryamohanan commented Oct 3, 2025

Which problem is this PR solving?

This PR fixes an issue in the Redis instrumentation for MULTI (transaction) commands where spans were not correctly handled for mixed command sets.

Previously, the MULTI span did not follow the semantic conventions and could not accurately represent it in the span data

According to this part of the semantic conventions:

db.operation.name: It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. For transactions and pipelined calls, if the individual operations are known to have the same command then that command SHOULD be used prepended by MULTI or PIPELINE. Otherwise db.operation.name SHOULD be MULTI or PIPELINE.

Short description of the changes

  • Updated the db.operation.name on the MULTI span:

    • Set to MULTI GET when all operations are GET.
    • Set to MULTI when commands are mixed, in compliance with the semantic conventions.
  • Added support for execAsPipeline, so that when MULTI is executed with execAsPipeline, it is treated as a pipeline in Redis instrumentation.

  • Expanded tests to cover multiple command scenarios.

Related issue: #3082

@aryamohanan aryamohanan force-pushed the fix-redis-multi-spans branch from 2dbf32e to fedac52 Compare October 3, 2025 08:23
@aryamohanan aryamohanan marked this pull request as ready for review October 3, 2025 08:59
@aryamohanan aryamohanan requested a review from a team as a code owner October 3, 2025 08:59
@aryamohanan
Copy link
Contributor Author

@pichlermarc Could you please take a look at this PR?

I’ve updated the Redis instrumentation to handle MULTI and pipeline spans according to the semantic conventions. Specifically:

  • Updated the db.operation.name on the MULTI span:

    • MULTI GET when all operations are GET.

    • MULTI when commands are mixed.

  • Added support for execAsPipeline, so that when MULTI is executed with execAsPipeline, it is treated as a pipeline in Redis instrumentation.

@aryamohanan
Copy link
Contributor Author

@blumamir Could you please take a look at this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants