Skip to content

Commit

Permalink
Update version for datadog.processAgent.runInCoreAgent (#1591)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-taf authored Nov 8, 2024
1 parent 3ffc983 commit 32f4d85
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 7 deletions.
4 changes: 4 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Datadog changelog

## 3.77.3

* Update version required for datadog.processAgent.runInCoreAgent and remove experimental status.

## 3.77.2

* Add the ability to include Security Contexts at the container level for Cluster Checks Runners.
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 3.77.2
version: 3.77.3
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
4 changes: 2 additions & 2 deletions charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.77.2](https://img.shields.io/badge/Version-3.77.2-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.77.3](https://img.shields.io/badge/Version-3.77.3-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)

[Datadog](https://www.datadoghq.com/) is a hosted infrastructure monitoring platform. This chart adds the Datadog Agent to all nodes in your cluster via a DaemonSet. It also optionally depends on the [kube-state-metrics chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics). For more information about monitoring Kubernetes with Datadog, please refer to the [Datadog documentation website](https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/).

Expand Down Expand Up @@ -792,7 +792,7 @@ helm install <RELEASE_NAME> \
| datadog.processAgent.enabled | bool | `true` | Set this to true to enable live process monitoring agent DEPRECATED. Set `datadog.processAgent.processCollection` or `datadog.processAgent.containerCollection` instead. # Note: /etc/passwd is automatically mounted when `processCollection`, `processDiscovery`, or `containerCollection` is enabled. # ref: https://docs.datadoghq.com/graphing/infrastructure/process/#kubernetes-daemonset |
| datadog.processAgent.processCollection | bool | `false` | Set this to true to enable process collection |
| datadog.processAgent.processDiscovery | bool | `true` | Enables or disables autodiscovery of integrations |
| datadog.processAgent.runInCoreAgent | bool | `false` | Set this to true to run the following features in the core agent: Live Processes, Live Containers, Process Discovery. # This is an experimental feature requiring Agent 7.53.0+ and Linux. Currently not compatible with APM Single Step Instrumentation. |
| datadog.processAgent.runInCoreAgent | bool | `false` | Set this to true to run the following features in the core agent: Live Processes, Live Containers, Process Discovery. # This requires Agent 7.57.0+ and Linux. |
| datadog.processAgent.stripProcessArguments | bool | `false` | Set this to scrub all arguments from collected processes # Requires datadog.processAgent.processCollection to be set to true to have any effect # ref: https://docs.datadoghq.com/infrastructure/process/?tab=linuxwindows#process-arguments-scrubbing |
| datadog.profiling.enabled | string | `nil` | Enable Continuous Profiler by injecting `DD_PROFILING_ENABLED` environment variable with the same value to all pods in the cluster Valid values are: - false: Profiler is turned off and can not be turned on by other means. - null: Profiler is turned off, but can be turned on by other means. - auto: Profiler is turned off, but the library will turn it on if the application is a good candidate for profiling. - true: Profiler is turned on. |
| datadog.prometheusScrape.additionalConfigs | list | `[]` | Allows adding advanced openmetrics check configurations with custom discovery rules. (Requires Agent version 7.27+) |
Expand Down
4 changes: 2 additions & 2 deletions charts/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{- $version = "6.55.1" -}}
{{- end -}}
{{- if and (eq $length 1) (or (eq $version "7") (eq $version "latest")) -}}
{{- $version = "7.55.1" -}}
{{- $version = "7.58.1" -}}
{{- end -}}
{{- $version -}}
{{- end -}}
Expand Down Expand Up @@ -971,7 +971,7 @@ Create RBACs for custom resources
false
{{- else if (ne (include "get-process-checks-in-core-agent-envvar" .) "") -}}
{{- include "get-process-checks-in-core-agent-envvar" . -}}
{{- else if and (not .Values.agents.image.doNotCheckTag) .Values.datadog.processAgent.runInCoreAgent (semverCompare ">=7.53.0-0" (include "get-agent-version" .)) -}}
{{- else if and (not .Values.agents.image.doNotCheckTag) .Values.datadog.processAgent.runInCoreAgent (semverCompare ">=7.57.0-0" (include "get-agent-version" .)) -}}
true
{{- else -}}
false
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ datadog:
processDiscovery: true

# datadog.processAgent.runInCoreAgent -- Set this to true to run the following features in the core agent: Live Processes, Live Containers, Process Discovery.
## This is an experimental feature requiring Agent 7.53.0+ and Linux. Currently not compatible with APM Single Step Instrumentation.
## This requires Agent 7.57.0+ and Linux.
runInCoreAgent: false

# datadog.processAgent.containerCollection -- Set this to true to enable container collection
Expand Down
80 changes: 79 additions & 1 deletion test/datadog/process_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
DDSystemProbeEnabled = "DD_SYSTEM_PROBE_ENABLED"
DDNetworkMonitoringEnabled = "DD_SYSTEM_PROBE_NETWORK_ENABLED"
DDOrchestratorEnabled = "DD_ORCHESTRATOR_EXPLORER_ENABLED"
DDLanguageDetectionEnabled = "DD_LANGUAGE_DETECTION_ENABLED"
)

func Test_processAgentConfigs(t *testing.T) {
Expand Down Expand Up @@ -247,6 +248,44 @@ func Test_processAgentConfigs(t *testing.T) {
},
assertions: verifyLinuxRunInCoreAgent,
},
{
name: "language detection on process agent",
command: common.HelmCommand{
ReleaseName: "datadog",
ChartPath: "../../charts/datadog",
ShowOnly: []string{"templates/daemonset.yaml"},
Values: []string{"../../charts/datadog/values.yaml"},
Overrides: map[string]string{
"datadog.apiKeyExistingSecret": "datadog-secret",
"datadog.appKeyExistingSecret": "datadog-secret",
"datadog.processAgent.runInCoreAgent": "false",
"datadog.processAgent.processCollection": "true",
"agents.image.tag": "7.56",
"datadog.apm.instrumentation.language_detection.enabled": "true",
"datadog.apm.instrumentation.enabled": "true",
},
},
assertions: verifyLanguageDetectionInProcessAgent,
},
{
name: "language detection on core agent",
command: common.HelmCommand{
ReleaseName: "datadog",
ChartPath: "../../charts/datadog",
ShowOnly: []string{"templates/daemonset.yaml"},
Values: []string{"../../charts/datadog/values.yaml"},
Overrides: map[string]string{
"datadog.apiKeyExistingSecret": "datadog-secret",
"datadog.appKeyExistingSecret": "datadog-secret",
"datadog.processAgent.runInCoreAgent": "true",
"datadog.processAgent.processCollection": "true",
"agents.image.tag": "7.57",
"datadog.apm.instrumentation.language_detection.enabled": "true",
"datadog.apm.instrumentation.enabled": "true",
},
},
assertions: verifyLanguageDetectionInCoreAgent,
},
}

for _, tt := range tests {
Expand All @@ -272,7 +311,7 @@ func verifyDaemonsetMinimal(t *testing.T, manifest string) {
assert.True(t, ok)
processEnvs := getEnvVarMap(processAgentContainer.Env)
assertDefaultCommonProcessEnvs(t, processEnvs)
assert.Equal(t, "false", coreEnvs[DDProcessRunInCoreAgentEnabled])
assert.Equal(t, "false", processEnvs[DDProcessRunInCoreAgentEnabled])
assert.True(t, getPasswdMount(t, processAgentContainer.VolumeMounts))
}

Expand Down Expand Up @@ -309,6 +348,45 @@ func verifyLinuxRunInCoreAgent(t *testing.T, manifest string) {
assert.False(t, ok)
}

func verifyLanguageDetectionInCoreAgent(t *testing.T, manifest string) {
var deployment appsv1.DaemonSet
common.Unmarshal(t, manifest, &deployment)
coreAgentContainer, ok := getContainer(t, deployment.Spec.Template.Spec.Containers, "agent")
assert.True(t, ok)
coreEnvs := getEnvVarMap(coreAgentContainer.Env)
assert.Equal(t, "true", coreEnvs[DDContainerCollectionEnabled])
assert.Equal(t, "true", coreEnvs[DDProcessCollectionEnabled])
assert.Equal(t, "true", coreEnvs[DDProcessDiscoveryEnabled])
assert.Equal(t, "false", coreEnvs[DDStripProcessArgs])
assert.Equal(t, "true", coreEnvs[DDProcessRunInCoreAgentEnabled])
assert.Equal(t, "true", coreEnvs[DDLanguageDetectionEnabled])
assert.True(t, getPasswdMount(t, coreAgentContainer.VolumeMounts))

_, ok = getContainer(t, deployment.Spec.Template.Spec.Containers, "process-agent")
assert.False(t, ok)
}

func verifyLanguageDetectionInProcessAgent(t *testing.T, manifest string) {
var deployment appsv1.DaemonSet
common.Unmarshal(t, manifest, &deployment)
coreAgentContainer, ok := getContainer(t, deployment.Spec.Template.Spec.Containers, "agent")
assert.True(t, ok)
coreEnvs := getEnvVarMap(coreAgentContainer.Env)
assert.Equal(t, "false", coreEnvs[DDProcessRunInCoreAgentEnabled])
assert.False(t, getPasswdMount(t, coreAgentContainer.VolumeMounts))

processAgentContainer, ok := getContainer(t, deployment.Spec.Template.Spec.Containers, "process-agent")
assert.True(t, ok)
processEnvs := getEnvVarMap(processAgentContainer.Env)
assert.Equal(t, "true", processEnvs[DDContainerCollectionEnabled])
assert.Equal(t, "true", processEnvs[DDProcessCollectionEnabled])
assert.Equal(t, "true", processEnvs[DDProcessDiscoveryEnabled])
assert.Equal(t, "false", processEnvs[DDStripProcessArgs])
assert.Equal(t, "false", processEnvs[DDProcessRunInCoreAgentEnabled])
assert.Equal(t, "true", processEnvs[DDLanguageDetectionEnabled])
assert.True(t, getPasswdMount(t, processAgentContainer.VolumeMounts))
}

func verifyChecksOff(t *testing.T, manifest string) {
var deployment appsv1.DaemonSet
common.Unmarshal(t, manifest, &deployment)
Expand Down

0 comments on commit 32f4d85

Please sign in to comment.