Unexpected behaviour with DD_PROCESS_AGENT_ENABLED=false
Describe what happened:
When DD_PROCESS_AGENT_ENABLED is precisely "false", neither container (unexpected) nor process-level metrics (expected) are collected.
Describe what you expected:
I would expect that the collection of container-level metrics would be unaffected by a value of "false" for DD_PROCESS_AGENT_ENABLED.
Additional environment details (Operating System, Cloud provider, etc):
- AWS
- ECS Fargate
- docker/agent:6.13.0 (with local extensions for secrets injection only)
- ECS tasks deployed by terraform (where conditionally not defining an environment variable is not easy).
Workaround
In my case, using the empty string in place of "false" had the desired effect of disabling process-level metrics while maintaining container-level metrics.
Hi @jonseymour
By container metrics, do you mean the metrics in the container live view? These metrics are also handled by the process agent, which means that if it is turned off, these won't be collected.
This behavior is listed in the bug fixes as it did not work like this before: https://github.com/DataDog/datadog-agent/blob/1e2200ba7b82009c1537310c83c3fa8b1cd2b018/CHANGELOG.rst#bug-fixes-2
Fix issue on process agent for DD_PROCESS_AGENT_ENABLED where 'false' did not turn off process/container collection.
This behavior is also commented in the code here: https://github.com/DataDog/datadog-agent/blob/master/pkg/process/config/yaml_config.go#L161-L163
I made a PR to update our doc regarding this parameter: https://github.com/DataDog/documentation/pull/5313
Let me know if you have further questions,
Simon
I think the documentation improvements help a bit, but I have to say it isn't an intuitive design for that variable at all.
The name of the variable -- _ENABLED -- suggests that it takes a boolean value (true or false) and if neither is specified then one might assume that the default value would be false. However, one finds that if one follows this intuition, rather than having the prescience to look up the source code or, now, the documentation then the variable doesn't take boolean values at all. This is reinforced by the fact that the agent documentation for "Live Containers" makes no reference whatsoever to the concept of a process agent or configuration for same and there is a completely separate section for "Live Processes" which does explicitly talk about the process agent and its configuration and makes no reference to any of this configuration affecting the operation of the "Live Containers" feature described elsewhere.
(snippy comment deleted)