DataDog / helm-charts

Helm charts for Datadog products
Apache License 2.0
330 stars 1.01k forks source link

Can't add DD_APM_MAX_TPS to cluster agent #1346

Closed arlando closed 4 months ago

arlando commented 4 months ago

Describe what happened:

I have an ArgoCD environment and I am attempting to pass the parameter to change the DD_APM_MAX_TPS setting. But having trouble changing this. What is the correct way to set this?

Describe what you expected:

The envDict setting applied to the Datadog cluster agent config as per https://github.com/DataDog/helm-charts/blob/main/charts/datadog/templates/_container-agent.yaml#L188. Note in the version 3.57.3 this is namespaced under clusterAgent.

Steps to reproduce the issue:

project: foo
source:
  repoURL: 'https://helm.datadoghq.com'
  targetRevision: 3.57.3
  helm:
    parameters:
      - name: clusterAgent.replicas
        value: '2'
      - name: clusterAgent.envDict[0].DD_APM_MAX_TPS
        value: '1'
  chart: datadog
destination:
  server: 'https://kube.svc'
  namespace: datadog
syncPolicy:
  syncOptions:
    - CreateNamespace=true

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

Helm datadog chart

tbavelier commented 4 months ago

This setting DD_APM_MAX_TPS is used by the trace-agent container of the core Agent pod, not the cluster Agent. You can simply use datadog.env :

datadog:
  env:
  - name: DD_APM_MAX_TPS
    value: 1

The envDict syntax would be :

datadog:
  envDict:
    DD_APM_MAX_TPS: 1

If you want to apply env vars to the cluster Agent, they should be passed with clusterAgent.env / clusterAgent.envFrom / clusterAgent.envDict with the same syntax as datadog.env only applies to the containers of the node Agent (the DaemonSet).

So the syntax with ArgoCD / Helm would be clusterAgent.envDict.DD_APM_MAX_TPS as envDict is a dictionary :

image

As mentioned in the beginning, this is a trace-Agent setting however, so it should be passed with datadog.env