Skip to content

contrib/redis/rueidis: add Mode method support (v1.0.56)#3360

Closed
korECM wants to merge 2 commits intoDataDog:mainfrom
korECM:feat/rueidis-support-v1.0.56
Closed

contrib/redis/rueidis: add Mode method support (v1.0.56)#3360
korECM wants to merge 2 commits intoDataDog:mainfrom
korECM:feat/rueidis-support-v1.0.56

Conversation

@korECM
Copy link
Copy Markdown
Contributor

@korECM korECM commented Mar 29, 2025

What does this PR do?

This PR updates the dd-trace-go integration for rueidis (in contrib/redis/rueidis) to support the Mode() method recently added to the rueidis.Client interface. This resolves a compile-time error that occurred when using dd-trace-go with rueidis versions v1.0.56 and later.

Specifically, it:

  1. Adds the Mode() rueidis.ClientMode method to the tracedClient wrapper.
  2. Updates the github.com/redis/rueidis dependency in go.mod to version v1.0.56 to ensure the necessary interface method exists and to align with the fix.

Motivation

As reported in discussion #3347 , newer versions of the rueidis library (starting from v1.0.56, due to changes in rueidis) introduced a Mode() method to their Client interface. This caused our tracedClient wrapper, which embeds the rueidis.Client, to no longer satisfy the interface, resulting in compile-time failures for users attempting to use dd-trace-go with these updated rueidis versions.

This PR directly addresses the incompatibility by implementing the missing Mode() method on our wrapper, simply calling the underlying client's method.

Regarding the Dependency Update:

Implementing this fix required updating the rueidis dependency to v1.0.56. We acknowledge that bumping dependency versions can potentially impact users who rely on older versions or have specific dependency constraints in their projects.

However, the alternative was leaving the integration broken for all users wanting to use rueidis v1.0.56 or newer. Given that this prevents users from adopting recent library updates alongside dd-trace-go, we decided that updating the dependency and fixing the compilation issue was the necessary path forward to restore functionality for those users. We believe this addresses a more immediate and blocking problem. We encourage reviewers to consider this trade-off.

Related Discussion: #3347

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Add a Mode method on the client struct so that it implements the
updated rueidis.Client interface. This fixes a compile error that
occurred when using the latest version of rueidis. See
DataDog#3347.

Also update go.mod and go.sum to bump github.com/redis/rueidis to
v1.0.56, along with related dependency upgrades.
@korECM korECM requested review from a team as code owners March 29, 2025 06:39
Copy link
Copy Markdown
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@darccio
Copy link
Copy Markdown
Member

darccio commented Apr 2, 2025

Thanks @korECM. We are merging the changes contributed in a previous PR #3301. Closing this one in favour of that one.

@darccio darccio closed this Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants