datadog-operator
datadog-operator copied to clipboard
Dogstatsd does not have a hostPort
Output of the info page (if this is a bug) (Not sure how to obtain this)
Describe what happened: On v1alpha1 CRD, metrics collection does not configure a hostPort (required per the conventional configuration of connecting statsds to hostip:8125) For a counterexample, APM does.
Describe what you expected:
When I enable dogstatsd
port 8125 should be bound to a host port (or at least have the option) so that the recommended configuration will work
Steps to reproduce the issue: Enable dogstatsd Observe that the port is created as follows:
ports:
- name: dogstatsdport
containerPort: 8125
protocol: UDP
Conspicuously missing is hostPort: 8125
Additional environment details (Operating System, Cloud provider, etc): EKS 1.22
I hit the same problem, finally I was able to solve it with DD support help (as far as I can tell, it's not documented anywhere).
To get the hostPort created, it must defined like this:
apiVersion: datadoghq.com/v1alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
agent:
config:
hostPort: 8125
...
env:
- name: DD_DOGSTATSD_NON_LOCAL_TRAFFIC
value: 'true'
Also, DD_DOGSTATSD_NON_LOCAL_TRAFFIC
env var must be set to true
.
I hope this helps.
For people coming here from google, if you are using v2alpha1, all you gotta do is:
kind: DatadogAgent
apiVersion: datadoghq.com/v2alpha1
metadata:
name: datadog
spec:
features:
dogstatsd:
hostPortConfig:
enabled: true
// ...
@JCMais thanks for providing the configuration for v2alpha1
! Since v1alpha1
is deprecated I'm closing the issue.