Skip to content

Commit dca03e3

Browse files
authored
Merge pull request #232 from DataDog/olivielpeau/fix-sd-config-vars
Fix sd_config_backend and sd_backend_host vars
2 parents 77cf970 + babb515 commit dca03e3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Some configuration parameters can be changed with environment variables:
6767
* `SD_BACKEND`, `SD_CONFIG_BACKEND`, `SD_BACKEND_HOST`, `SD_BACKEND_PORT`, `SD_TEMPLATE_DIR`, `SD_CONSUL_TOKEN`, `SD_BACKEND_USER` and `SD_BACKEND_PASSWORD` configure Autodiscovery (previously known as Service Discovery):
6868

6969
- `SD_BACKEND`: set to `docker` (the only supported backend) to enable Autodiscovery.
70-
- `SD_CONFIG_BACKEND`: set to `etcd`, `consul`, or `zookeeper` to use one of these key-value stores as a template source.
70+
- `SD_CONFIG_BACKEND`: set to `etcd`, `consul`, or `zk` to use one of these key-value stores as a template source.
7171
- `SD_BACKEND_HOST` and `SD_BACKEND_PORT`: configure the connection to the key-value template source.
7272
- `SD_TEMPLATE_DIR`: when using SD_CONFIG_BACKEND, set the path where the check configuration templates are located in the key-value store (default is `datadog/check_configs`)
7373
- `SD_CONSUL_TOKEN`: when using Consul as a template source and the Consul cluster requires authentication, set a token so the Datadog Agent can connect.

config_builder.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,13 @@ def set_sd_backend_host(self):
125125
Used for building datadog.conf
126126
Sets sd_config_backend and sd_backend_host depending on the environment
127127
'''
128-
_config_backend = getenv('SD_CONFIG_BACKEND', 'sd_config_backend')
128+
_config_backend = getenv('SD_CONFIG_BACKEND')
129129
if _config_backend is not None:
130-
_backend_host = getenv('SD_BACKEND_HOST', 'sd_backend_host')
131-
if _backend_host is None:
130+
self.set_property('sd_config_backend', _config_backend)
131+
_backend_host = getenv('SD_BACKEND_HOST')
132+
if _backend_host is not None:
133+
self.set_property('sd_backend_host', _backend_host)
134+
else:
132135
_timeout = getdefaulttimeout()
133136
try:
134137
setdefaulttimeout(1)

0 commit comments

Comments
 (0)