datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

Feature: Easy configuration of the agent itself when containerized

Open zen0wu opened this issue 6 years ago • 3 comments

Describe what happened:

When using a containerized agent, it's easy to configure other integrations. But it's super cumbersome to configure

  • The agent itself (/etc/datadog-agent/datadog.yaml)
  • The docker integration (/etc/datadog-agent/conf.d/docker.d/conf.yaml)

Describe what you expected:

I would expect they can be configured similarly as in other integrations - Either via environment variables, or Docker labels. But there's no environment variables for non-common settings (for me it's secret_backend_command), and for docker integration, the auto discovery integration will be overriden by the default config provided by the agent image.

The other alternative I tried is to mount /etc/datadog-agent as a whole with both datadog.yaml and conf.d/docker.d/conf.yaml in the volume, but then I lose all the default integrations like io, disk, process. And I don't want to pull in all the config files in my codebase. It's also not future proof - What if the default settings of datadog-agent changes/there's new system-level integration.

The only working solution is I have mount 3 volumes - Two for the config files above, and one for the custom secret backend command. It's far from ideal.

Steps to reproduce the issue:

N/A

Additional environment details (Operating System, Cloud provider, etc):

zen0wu avatar Aug 14 '20 17:08 zen0wu

Hey @zen0wu

Thanks for reaching out! For the secret_backend_command parameter, our config.go file says that you can use an env var: https://github.com/DataDog/datadog-agent/blob/master/pkg/config/config.go#L216 For the core agent (not trace or process), every parameter prefixed by this method: BindEnvAndSetDefault is configurable via an env var with DD_ in front, all caps, and underscores replacing dots. So, that would be DD_SECRET_BACKEND_COMMAND for your case.

About the docker integration configuration, our init script here: https://github.com/DataDog/datadog-agent/blob/master/Dockerfiles/agent/entrypoint/51-docker.sh#L22 will not replace the yaml file if it already exist. So, if you mount a file that contains the docker integration configuration here: /etc/datadog-agent/conf.d/docker.d/conf.yaml.example it won't be overwritten.

Let us know how it goes when you try these options out!

Thanks

Simwar avatar Aug 17 '20 15:08 Simwar

This issue has been automatically marked as stale because it has not had activity in the past 15 days.

It will be closed in 30 days if no further activity occurs. If this issue is still relevant, adding a comment will keep it open. Also, you can always reopen the issue if you missed the window.

Thank you for your contributions!

dd-octo-sts avatar Oct 22 '25 04:10 dd-octo-sts

Automatically closed due to inactivity.

jacjtito avatar Jan 04 '26 17:01 jacjtito