Skip to content

Commit

Permalink
add username & password etcd options
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed Jun 6, 2017
1 parent b5f10cf commit 3b39f86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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
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

0 comments on commit 3b39f86

Please sign in to comment.