From a852e8d30d82c36c6697c09a6104eb7a1cc2827c Mon Sep 17 00:00:00 2001 From: Olivier Vielpeau Date: Thu, 24 Aug 2017 15:47:52 -0400 Subject: [PATCH 1/2] [config_builder] Actually set sd_config_backend and sd_backend_host --- config_builder.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config_builder.py b/config_builder.py index 3b52cdce..c456a34f 100755 --- a/config_builder.py +++ b/config_builder.py @@ -125,10 +125,13 @@ def set_sd_backend_host(self): Used for building datadog.conf Sets sd_config_backend and sd_backend_host depending on the environment ''' - _config_backend = getenv('SD_CONFIG_BACKEND', 'sd_config_backend') + _config_backend = getenv('SD_CONFIG_BACKEND') if _config_backend is not None: - _backend_host = getenv('SD_BACKEND_HOST', 'sd_backend_host') - if _backend_host is None: + self.set_property('sd_config_backend', _config_backend) + _backend_host = getenv('SD_BACKEND_HOST') + if _backend_host is not None: + self.set_property('sd_backend_host', _backend_host) + else: _timeout = getdefaulttimeout() try: setdefaulttimeout(1) From babb515b0c522ff030ed75608a3b85d7d5d0a202 Mon Sep 17 00:00:00 2001 From: Olivier Vielpeau Date: Thu, 24 Aug 2017 15:50:30 -0400 Subject: [PATCH 2/2] [readme] Fix typo: `zookeeper` -> `zk` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc71396e..af406b88 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Some configuration parameters can be changed with environment variables: * `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): - `SD_BACKEND`: set to `docker` (the only supported backend) to enable Autodiscovery. - - `SD_CONFIG_BACKEND`: set to `etcd`, `consul`, or `zookeeper` to use one of these key-value stores as a template source. + - `SD_CONFIG_BACKEND`: set to `etcd`, `consul`, or `zk` to use one of these key-value stores as a template source. - `SD_BACKEND_HOST` and `SD_BACKEND_PORT`: configure the connection to the key-value template source. - `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`) - `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.