Skip to content

Add support for redis-rb 6 - #6142

Open
vpellan wants to merge 2 commits into
masterfrom
vpellan/redis-rb-6-support
Open

Add support for redis-rb 6#6142
vpellan wants to merge 2 commits into
masterfrom
vpellan/redis-rb-6-support

Conversation

@vpellan

@vpellan vpellan commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Add support for redis-rb 6 by stripping the per-connection handshake verbs (HELLO, CLIENT SETINFO/SETNAME)

Motivation:

Ci failed in #6141

Change log entry

Yes. Add support for redis-rb 6.0/RESP3

Additional Notes:

How to test the change?

@vpellan
vpellan requested review from a team as code owners August 3, 2026 11:57
@vpellan
vpellan requested review from mabdinur and marcotc August 3, 2026 11:57
@dd-octo-sts dd-octo-sts Bot added integrations Involves tracing integrations tracing labels Aug 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a655e93719

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/datadog/tracing/contrib/redis/trace_middleware.rb
Comment thread lib/datadog/tracing/contrib/redis/quantize.rb Outdated
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Aug 3, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 90.02% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: bf2b132 | Docs | Datadog PR Page | Give us feedback!

@vpellan
vpellan force-pushed the vpellan/redis-rb-6-support branch from a655e93 to 3dfa8b0 Compare August 3, 2026 12:17
@pr-commenter

pr-commenter Bot commented Aug 3, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-03 13:17:13

Comparing candidate commit bf2b132 in PR branch vpellan/redis-rb-6-support with baseline commit 4f14253 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 1 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:tracing - trace.to_digest - Continue

  • unstable throughput [-1422.846op/s; +1570.025op/s] or [-4.836%; +5.336%]

# `redis-client` sends its per-connection handshake (`HELLO`, `CLIENT SETINFO`/`SETNAME`)
# as a pipeline through this same code path. Excluding those from resource naming keeps
# the resource focused on application-issued commands (e.g. a lone `SELECT` prelude).
traced_commands = commands.reject { |c| Contrib::Redis::Quantize.connection_setup_command?(c) }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Is it possible for connection_setup_command to process something that throws an error? If so, some error handling for this line could be useful.

# `redis-client` always emits this as `["HELLO", "3", "AUTH", username, password]` — check
# the fixed "AUTH" keyword position only, never the username/password values themselves,
# since those are untrusted, possibly-binary bulk strings that `#upcase` can raise on.
command_args.first.to_s.upcase == "HELLO" && command_args[2].to_s.upcase == "AUTH"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two different style of array access in a single line command_args.first and command_args[2], let's just use one, command_args[0] and command_args[2]

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

Labels

integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants