Skip to content

Commit

Permalink
chore: add elastic search sniffing configuration option setting. (#731)
Browse files Browse the repository at this point in the history
Allows users to disable sniffing based on their specific Elasticsearch deplyment instance and environment.
This change is due to issues with proxies and irrelevant hostnames for some elasticsearch instances from cloud providers.
It enables application of sniffing best practices as described in this [link](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how)
  • Loading branch information
Muchogoc authored Jul 12, 2024
1 parent 95955c5 commit 2ecd12c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
ES_VERIFY_CERTS = os.environ.get('ES_VERIFY_CERTS', str(ES_SCHEME == 'https'))
ES_USER = os.environ.get('ES_USER', None)
ES_PASSWORD = os.environ.get('ES_PASSWORD', None)
ES_ENABLE_SNIFFING = os.environ.get('ES_ENABLE_SNIFFING', True)
http_auth = None
if ES_USER and ES_PASSWORD:
http_auth = (ES_USER, ES_PASSWORD)
Expand All @@ -219,8 +220,8 @@
'http_auth': http_auth,
'use_ssl': ES_SCHEME == 'https',
'verify_certs': ES_VERIFY_CERTS.lower() == 'true',
'sniff_on_connection_fail': True,
'sniff_on_start': True,
'sniff_on_connection_fail': ES_ENABLE_SNIFFING,
'sniff_on_start': ES_ENABLE_SNIFFING,
'sniffer_timeout': 60,
'sniff_timeout': 10,
'max_retries': 3,
Expand Down

0 comments on commit 2ecd12c

Please sign in to comment.