Enable to set Trace Environment via env-var #245
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Enable to set Trace Environment.
For example, when you add
DD_TRACE_CONF_ENV=staging
to docker-dd-agent container, new lines will be added indatadog.conf
like this:About implementation
I understand you manage configurations in
datadog.conf
byconfig_builder.py
. At first I tried to modify the file. But it looksconfig_builder.py
doesn't support trace conf currently. Then I modifiedentrypoint.sh
instead ofconfig_builder.py
. I don't know this is right way. So I'd like to hear maintainers feedback.Motivation
To allow docker-dd-agent users to set Trace Environment via environment variable.
I have multiple Kubernetes clusters such as "production", "staging". I run docker-dd-agent as daemonSets in each cluster. I have started to use Datadog APM on those cluster. To avoid to force each tracer to set "env" (because our development team is planning to deploy tons of services), I'd like to set it via trace agent. But currently it looks docker-dd-agent doesn't allow to set it via environment variable.