DataDog / datadog-agent

Main repository for Datadog Agent
https://docs.datadoghq.com/
Apache License 2.0
2.84k stars 1.19k forks source link

Agent configuration missing hostPort #7844

Open tonglil opened 3 years ago

tonglil commented 3 years ago

Describe what happened: The manifests provided are missing the hostPort parameter that maps the dogstatsd and trace ports to the node.

https://github.com/DataDog/datadog-agent/blob/64a47bfdc7a78e690c89b62024d0f4f650f4c69a/Dockerfiles/manifests/agent.yaml#L26-L28 https://github.com/DataDog/datadog-agent/blob/64a47bfdc7a78e690c89b62024d0f4f650f4c69a/Dockerfiles/manifests/all-containers/daemonset.yaml#L28-L30 https://github.com/DataDog/datadog-agent/blob/64a47bfdc7a78e690c89b62024d0f4f650f4c69a/Dockerfiles/manifests/agent-only/daemonset.yaml#L24-L27 etc

Without it, traces and dogstatsd metrics are not collected.

Describe what you expected: The values included in the manifests.

Steps to reproduce the issue: Use these manifests to collect that info.

Additional details: Why these fields are not there by default when they are listed as necessary here?

kaitlavs commented 3 years ago

Hi @tonglil. The values that we use for generating the manifest you linked to do not have DogStatsD enabled, so this behavior is expected. If you are interested, we can provide a sample manifest where DogStats is enabled.

tonglil commented 3 years ago

Yes that would be great.

The first link seems to indicate that they are enabled? Are they generated from a different file?

c0state commented 2 years ago

Hi @tonglil. The values that we use for generating the manifest you linked to do not have DogStatsD enabled, so this behavior is expected. If you are interested, we can provide a sample manifest where DogStats is enabled.

By this you mean that it's effectively disabled since the hostPort isn't specified? But how come it is specified for the trace agent though (https://docs.datadoghq.com/resources/yaml/datadog-agent-all-features.yaml line 680)? The implications of using hostPort are the same for both the trace agent and the dogstatsd agent no?

kaitlavs commented 2 years ago

Hi @c0state

We generate the manifests from our helm chart. In the helm chart, you can see that using the hostPort for dogstatsd is disabled by default: https://github.com/DataDog/helm-charts/blob/4854358f480745adfbffa697a36cff37d6e4dcf8/charts/datadog/values.yaml#L280-L287=.

We have this disabled by default because we do not want to open a hostPort in a customer's environment unless they are using the feature. Therefore, if you want to enable dogstatsd using the daemonset, you must be sure to add the hostPort configuration manually.

The reason that APM has the hostPort section is because we list it as feature that is enabled for this manifest in the setup docs: https://a.cl.ly/2NumDkQk. That being the case, if a customer is using this specific manifest, they are likely using APM, and so we are not worried about opening up an unused hostPort.

Overall, we recommend using the helm chart to install the agent, because all these manual configuration steps can be handled OOTB with the chart by just enabling the helm parameters.