Skip to content

Instantly share code, notes, and snippets.

@davewongillies
Created February 3, 2015 10:08
Show Gist options
  • Select an option

  • Save davewongillies/7cce25a20188b05c2334 to your computer and use it in GitHub Desktop.

Select an option

Save davewongillies/7cce25a20188b05c2334 to your computer and use it in GitHub Desktop.
sentry.conf.py with redis sentinel
from redis.sentinel import Sentinel
sentinel = Sentinel([
('redis-sentinel1', 26379),
('redis-sentinel2', 26379),
('redis-sentinel3', 26379),
], socket_timeout=0.1)
redis_host = sentinel.discover_master('sentry')
SENTRY_REDIS_OPTIONS = {
'hosts': {
0: {
'host': redis_host[0],
'port': redis_host[1],
}
}
}
@Aergonus
Copy link

Aergonus commented Aug 20, 2019

Note that Version 8.2.0 deprecates SENTRY_REDIS_OPTIONS, new version is

    SENTRY_OPTIONS.update({
        'redis.clusters': {
            'default': {
                'hosts': {
                    0: {
                        'host': redis_host[0],
                        'port': redis_host[1],
                    },
                },
            },
        },
    })

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