Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AD] add support for etcd auth #3357

Merged
merged 2 commits into from
Jun 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions datadog.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ gce_updated_hostname: yes
# sd_backend_host: 127.0.0.1
# sd_backend_port: 4001
#
# If you use etcd, you can set a username and password for auth
#
# sd_backend_username:
# sd_backend_password:
#
# By default, the agent will look for the configuration templates under the
# `/datadog/check_configs` key in the back-end. If you wish otherwise, uncomment this option
# and modify its value.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ntplib==0.3.3
# utils/service_discovery/config_stores.py
python-consul==0.4.7
# utils/service_discovery/config_stores.py
python-etcd==0.4.2
python-etcd==0.4.5
# the libyaml bindings are optional
pyyaml==3.11
# note: requests is also used in many checks
Expand Down
4 changes: 4 additions & 0 deletions utils/service_discovery/etcd_config_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def _extract_settings(self, config):
settings = {
'host': config.get('sd_backend_host', DEFAULT_ETCD_HOST),
'port': int(config.get('sd_backend_port', -1)),
'username': config.get('sd_backend_username', None),
'password': config.get('sd_backend_password', None),
# these two are always set to their default value for now
'allow_reconnect': config.get('etcd_allow_reconnect', DEFAULT_RECO),
'protocol': config.get('etcd_protocol', DEFAULT_ETCD_PROTOCOL),
Expand All @@ -45,6 +47,8 @@ def get_client(self, reset=False):
self.client = etcd_client(
host=self.settings.get('host'),
port=port,
username=self.settings.get('username'),
password=self.settings.get('password'),
allow_reconnect=self.settings.get('allow_reconnect'),
protocol=self.settings.get('protocol'),
)
Expand Down