redis_sentinel: Add SSL/TLS, username/ACL, and Redis 7+ replica support#2939
Open
amendez-primer wants to merge 6 commits intoDataDog:masterfrom
Open
redis_sentinel: Add SSL/TLS, username/ACL, and Redis 7+ replica support#2939amendez-primer wants to merge 6 commits intoDataDog:masterfrom
amendez-primer wants to merge 6 commits intoDataDog:masterfrom
Conversation
Fixes DataDog#2938 The check previously created Redis connections without any SSL/TLS parameters, making it impossible to connect to TLS-enabled Sentinel instances. This adds support for ssl, ssl_certfile, ssl_keyfile, ssl_ca_certs, and ssl_cert_reqs instance config options.
- Add SSL/TLS connection params (ssl, ssl_certfile, ssl_keyfile, ssl_ca_certs, ssl_cert_reqs) to match the core redisdb integration - Add username param for Redis 6+ ACL support (fixes DataDog#2395) - Use sentinel_replicas() with fallback to sentinel_slaves() for Redis 7+ compatibility (fixes DataDog#1586) - Add socket_timeout support to prevent hanging on unreachable sentinels Fixes DataDog#2938, DataDog#2395, DataDog#1586
redis-py 4.2+ adds sentinel_replicas() needed for Redis 7+ compat. Also requires username param support for Redis 6+ ACLs.
lucia-sb
requested changes
Mar 20, 2026
lucia-sb
left a comment
There was a problem hiding this comment.
Hi! Could you run ddev test --fmt to fix the linting failures?
Thanks!!
Run ruff check --fix and ruff format to fix linting failures: - Add trailing comma after **ssl_kwargs - Remove extra blank lines between imports
|
@amendez-primer Could you make sure you’re using the latest version of ddev (14.4.0) when running the command? The formatting requirements can sometimes change between versions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernizes the Redis Sentinel check to support TLS-enabled deployments, Redis 6+ ACLs, and Redis 7+ command changes.
Fixes #2938, #2395, #1586
Changes
1. SSL/TLS support (#2938)
The check previously created
redis.StrictRedisconnections without any SSL parameters, making it impossible to connect to TLS-enabled Sentinel instances (e.g. AWS ElastiCache, Azure Cache for Redis).Added support for:
ssl,ssl_certfile,ssl_keyfile,ssl_ca_certs,ssl_cert_reqs— matching the coreredisdbintegration.2. Username / ACL support (#2395)
Redis 6+ introduced ACLs requiring a
usernameparameter. Without it,AUTHfails with:AUTH <password> called without any password configured for the default user.Added
sentinel_usernameinstance config option, passed through toStrictRedis(username=...).3. Redis 7+ REPLICAS command (#1586)
Redis 7 removed the
SENTINEL SLAVESsubcommand in favor ofSENTINEL REPLICAS. The check now usessentinel_replicas()(redis-py 4.2+) with a fallback tosentinel_slaves()for older Redis versions.4. Socket timeout
Added
socket_timeoutconfig option (default: 5s) to prevent the check from hanging indefinitely on unreachable sentinels.Files changed
redis_sentinel.py_load_config();_get_sentinel_replicas()helperconf.yaml.exampletest_redis_sentinel.pypyproject.tomlredisdep from2.10.5to>=4.5.0Example config (Helm)
Backward compatibility
ssl: true, behavior is identical to before_get_sentinel_replicas()falls back tosentinel_slaves()ifsentinel_replicas()is unavailable