From 7225e2704f0e1a1f06c6aed9665da843293fd186 Mon Sep 17 00:00:00 2001 From: Seigo Uchida Date: Thu, 28 Sep 2017 23:12:15 +0900 Subject: [PATCH] Enable to set Trace Environment via env-var This change makes docker-dd-agent users to set Trace Environment via environment variable. For example, when you add `DD_TRACE_CONF_ENV=staging`, new lines will be added in datadog.conf like this: ``` [trace.config] env = staging ``` --- entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index c46e9a11..9375dd3f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,6 +27,12 @@ stderr_logfile=\/dev\/stderr\ stderr_logfile_maxbytes=0' ${DD_ETC_ROOT}/supervisor.conf fi +##### Trace Agent config ##### +if [ ! "${DD_TRACE_CONF_ENV}" = "" ]; then + sed -i -e '$ a [trace.config]' ${DD_ETC_ROOT}/datadog.conf + sed -i -e "$ a env = ${DD_TRACE_CONF_ENV}" ${DD_ETC_ROOT}/datadog.conf +fi + ##### Integrations config ##### if [ $KUBERNETES ]; then