From 55840ad5606fe3dbd5fcfb92c4e84fa46a992f19 Mon Sep 17 00:00:00 2001 From: Daniel Tafoya Date: Fri, 27 Mar 2026 19:24:02 +0000 Subject: [PATCH 1/2] [CXP-2639] Remove run_in_core_agent envvar override and cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the envvar override check from ShouldRunProcessChecksInCoreAgent() since DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED is being phased out (removed in Agent 7.78). The features continue to inject the envvar for backward compatibility — this will naturally stop once AgentLatestVersion bumps to >= 7.78. Also removes the envvar from OtelAgentGateway and ClusterChecksRunner defaults, the yaml-mapper mapping, and the envvar override test cases. Co-Authored-By: Claude Opus 4.6 (1M context) --- ...ping_datadog_helm_to_datadogagent_crd.yaml | 1 - docs/deprecated_configs.md | 8 +++--- .../component/clusterchecksrunner/default.go | 4 --- .../datadogagent/feature/apm/feature_test.go | 26 ----------------- .../feature/livecontainer/feature_test.go | 15 ---------- .../feature/liveprocess/feature_test.go | 15 ---------- .../feature/processdiscovery/feature_test.go | 15 ---------- .../datadogagent/feature/utils/utils.go | 28 ++++--------------- .../datadogagent/global/otelagentgateway.go | 5 ---- 9 files changed, 9 insertions(+), 108 deletions(-) diff --git a/cmd/yaml-mapper/mapper/mapping_datadog_helm_to_datadogagent_crd.yaml b/cmd/yaml-mapper/mapper/mapping_datadog_helm_to_datadogagent_crd.yaml index 3c36f05b5..46a64596c 100644 --- a/cmd/yaml-mapper/mapper/mapping_datadog_helm_to_datadogagent_crd.yaml +++ b/cmd/yaml-mapper/mapper/mapping_datadog_helm_to_datadogagent_crd.yaml @@ -512,7 +512,6 @@ datadog.processAgent.containerCollection: spec.features.liveContainerCollection. datadog.processAgent.enabled: "" datadog.processAgent.processCollection: spec.features.liveProcessCollection.enabled datadog.processAgent.processDiscovery: spec.features.processDiscovery.enabled -datadog.processAgent.runInCoreAgent: spec.global.runProcessChecksInCoreAgent datadog.processAgent.stripProcessArguments: spec.features.liveProcessCollection.stripProcessArguments datadog.profiling.enabled: "" datadog.prometheusScrape.additionalConfigs: diff --git a/docs/deprecated_configs.md b/docs/deprecated_configs.md index 1ac0c73c2..490d1b4a4 100644 --- a/docs/deprecated_configs.md +++ b/docs/deprecated_configs.md @@ -12,11 +12,11 @@ This document lists configuration options that are deprecated or will be depreca ### runProcessChecksInCoreAgent -The `runProcessChecksInCoreAgent` field in the Global configuration is being deprecated. This field previously controlled whether the Process Agent or Core Agent collects process and container checks and featurres. +The `runProcessChecksInCoreAgent` field in the Global configuration has been removed. This field previously controlled whether the Process Agent or Core Agent collects process and container checks and features. ### Migration Path -Process checks are now run in the core Agent by default. +Process checks are now run in the core Agent by default. -If this field was set to `true`, it can be removed with no behavior change. If you are using Agent v7.60 or below, you can use environment variable overrides or upgrade your Agent version. +As of Agent 7.78, the `process_config.run_in_core_agent.enabled` config key has been removed from the Agent. On Linux, process checks always run in the core Agent — no configuration toggle is needed. -If this field was set to `false`, use the environment variable override (`DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED=false`) to disable this functionality. \ No newline at end of file +If this field was set to `true`, it can be removed with no behavior change. If you are using Agent v7.60 or below, you can use environment variable overrides or upgrade your Agent version. diff --git a/internal/controller/datadogagent/component/clusterchecksrunner/default.go b/internal/controller/datadogagent/component/clusterchecksrunner/default.go index 10cb05687..caae77673 100644 --- a/internal/controller/datadogagent/component/clusterchecksrunner/default.go +++ b/internal/controller/datadogagent/component/clusterchecksrunner/default.go @@ -242,10 +242,6 @@ func defaultEnvVars(dda metav1.Object) []corev1.EnvVar { Name: common.DDProcessCollectionEnabled, Value: "false", }, - { - Name: common.DDProcessConfigRunInCoreAgent, - Value: "false", - }, { Name: common.DDContainerCollectionEnabled, Value: "true", diff --git a/internal/controller/datadogagent/feature/apm/feature_test.go b/internal/controller/datadogagent/feature/apm/feature_test.go index fba02accf..77142f747 100644 --- a/internal/controller/datadogagent/feature/apm/feature_test.go +++ b/internal/controller/datadogagent/feature/apm/feature_test.go @@ -348,32 +348,6 @@ func TestAPMFeature(t *testing.T) { WantConfigure: true, ClusterAgent: testAPMInstrumentationNamespaces(), }, - { - Name: "single step instrumentation with language detection enabled, process check runs in process agent", - DDA: testutils.NewDatadogAgentBuilder(). - WithAPMEnabled(true). - WithAPMHostPortEnabled(true, apiutils.NewInt32Pointer(8126)). - WithAPMUDSEnabled(true, apmSocketHostPath). - WithAPMSingleStepInstrumentationEnabled(true, nil, nil, nil, true, "", nil, ""). - WithAdmissionControllerEnabled(true). - WithComponentOverride( - v2alpha1.NodeAgentComponentName, - v2alpha1.DatadogAgentComponentOverride{ - Image: &v2alpha1.AgentImageConfig{Tag: "7.60.0"}, - Env: []corev1.EnvVar{{Name: "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED", Value: "false"}}, - }, - ). - Build(), - WantConfigure: true, - ClusterAgent: testAPMInstrumentationWithLanguageDetectionEnabledForClusterAgent(), - Agent: testAPMInstrumentationWithLanguageDetectionForNodeAgent(true, false), - WantDependenciesFunc: func(t testing.TB, store store.StoreClient) { - _, found := store.Get(kubernetes.ClusterRoleBindingKind, "", "-apm-cluster-agent") - if !found { - t.Error("Should have created proper RBAC for language detection") - } - }, - }, { Name: "single step instrumentation without language detection enabled", DDA: testutils.NewDatadogAgentBuilder(). diff --git a/internal/controller/datadogagent/feature/livecontainer/feature_test.go b/internal/controller/datadogagent/feature/livecontainer/feature_test.go index 5944c064c..0e45532d9 100644 --- a/internal/controller/datadogagent/feature/livecontainer/feature_test.go +++ b/internal/controller/datadogagent/feature/livecontainer/feature_test.go @@ -56,21 +56,6 @@ func TestLiveContainerFeature(t *testing.T) { WantConfigure: true, Agent: testExpectedAgent(apicommon.ProcessAgentContainerName, false), }, - { - Name: "live container collection disabled on core agent via env var override", - DDA: testutils.NewDatadogAgentBuilder(). - WithLiveContainerCollectionEnabled(true). - WithComponentOverride( - v2alpha1.NodeAgentComponentName, - v2alpha1.DatadogAgentComponentOverride{ - Image: &v2alpha1.AgentImageConfig{Tag: "7.60.0"}, - Env: []corev1.EnvVar{{Name: "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED", Value: "false"}}, - }, - ). - Build(), - WantConfigure: true, - Agent: testExpectedAgent(apicommon.ProcessAgentContainerName, false), - }, } tests.Run(t, buildLiveContainerFeature) diff --git a/internal/controller/datadogagent/feature/liveprocess/feature_test.go b/internal/controller/datadogagent/feature/liveprocess/feature_test.go index 2fa6c2610..3a9453aa5 100644 --- a/internal/controller/datadogagent/feature/liveprocess/feature_test.go +++ b/internal/controller/datadogagent/feature/liveprocess/feature_test.go @@ -63,21 +63,6 @@ func Test_liveProcessFeature_Configure(t *testing.T) { WantConfigure: true, Agent: testExpectedAgent(apicommon.ProcessAgentContainerName, false, false), }, - { - Name: "live process collection disabled in core agent via env var override", - DDA: testutils.NewDatadogAgentBuilder(). - WithLiveProcessEnabled(true). - WithComponentOverride( - v2alpha1.NodeAgentComponentName, - v2alpha1.DatadogAgentComponentOverride{ - Image: &v2alpha1.AgentImageConfig{Tag: "7.60.0"}, - Env: []corev1.EnvVar{{Name: "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED", Value: "false"}}, - }, - ). - Build(), - WantConfigure: true, - Agent: testExpectedAgent(apicommon.ProcessAgentContainerName, false, false), - }, { Name: "live process collection enabled on single container", DDA: testutils.NewDatadogAgentBuilder(). diff --git a/internal/controller/datadogagent/feature/processdiscovery/feature_test.go b/internal/controller/datadogagent/feature/processdiscovery/feature_test.go index 2f2b26277..9db8f8f64 100644 --- a/internal/controller/datadogagent/feature/processdiscovery/feature_test.go +++ b/internal/controller/datadogagent/feature/processdiscovery/feature_test.go @@ -47,21 +47,6 @@ func Test_processDiscoveryFeature_Configure(t *testing.T) { WantConfigure: true, Agent: testExpectedAgent(apicommon.CoreAgentContainerName, true), }, - { - Name: "process discovery disabled in core agent via env vars", - DDA: testutils.NewDatadogAgentBuilder(). - WithProcessDiscoveryEnabled(true). - WithComponentOverride( - v2alpha1.NodeAgentComponentName, - v2alpha1.DatadogAgentComponentOverride{ - Image: &v2alpha1.AgentImageConfig{Tag: "7.60.0"}, - Env: []corev1.EnvVar{{Name: "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED", Value: "false"}}, - }, - ). - Build(), - WantConfigure: true, - Agent: testExpectedAgent(apicommon.ProcessAgentContainerName, false), - }, { Name: "process discovery without min version to run in core agent", DDA: testutils.NewDatadogAgentBuilder(). diff --git a/internal/controller/datadogagent/feature/utils/utils.go b/internal/controller/datadogagent/feature/utils/utils.go index 2c4e55be6..a81da2093 100644 --- a/internal/controller/datadogagent/feature/utils/utils.go +++ b/internal/controller/datadogagent/feature/utils/utils.go @@ -6,8 +6,6 @@ package utils import ( - "strconv" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1" @@ -40,28 +38,12 @@ func agentSupportsRunInCoreAgent(ddaSpec *v2alpha1.DatadogAgentSpec) bool { return utils.IsAboveMinVersion(images.AgentLatestVersion, ProcessConfigRunInCoreAgentMinVersion, nil) } -// ShouldRunProcessChecksInCoreAgent determines whether allow process checks to run in core agent based on -// environment variables and the agent version. +// ShouldRunProcessChecksInCoreAgent determines whether process checks should run in the core agent +// based on the agent version. Agents >= 7.60.0 support running process checks in the core agent. +// Note: As of Agent 7.78, process checks always run in the core agent on Linux and the +// DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED envvar is no longer recognized. func ShouldRunProcessChecksInCoreAgent(ddaSpec *v2alpha1.DatadogAgentSpec) bool { - - // Prioritize env var override - if nodeAgent, ok := ddaSpec.Override[v2alpha1.NodeAgentComponentName]; ok { - for _, env := range nodeAgent.Env { - if env.Name == common.DDProcessConfigRunInCoreAgent { - val, err := strconv.ParseBool(env.Value) - if err == nil { - return val - } - } - } - } - - // Check if agent version supports process checks running in core agent - if !agentSupportsRunInCoreAgent(ddaSpec) { - return false - } - - return true + return agentSupportsRunInCoreAgent(ddaSpec) } func HasFeatureEnableAnnotation(dda metav1.Object, annotation string) bool { diff --git a/internal/controller/datadogagent/global/otelagentgateway.go b/internal/controller/datadogagent/global/otelagentgateway.go index 1448135c0..8d1ef8b22 100644 --- a/internal/controller/datadogagent/global/otelagentgateway.go +++ b/internal/controller/datadogagent/global/otelagentgateway.go @@ -68,11 +68,6 @@ func applyOtelAgentGatewayResources(manager feature.PodTemplateManagers, ddaSpec Value: "false", }) - manager.EnvVar().AddEnvVarToContainer(apicommon.OtelAgent, &corev1.EnvVar{ - Name: "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED", - Value: "false", - }) - manager.EnvVar().AddEnvVarToContainer(apicommon.OtelAgent, &corev1.EnvVar{ Name: "DD_REMOTE_CONFIGURATION_ENABLED", Value: "false", From 1a6096cc555cde79a9af3224cab9ec558cf9c6bf Mon Sep 17 00:00:00 2001 From: Daniel Tafoya Date: Fri, 27 Mar 2026 19:34:58 +0000 Subject: [PATCH 2/2] [CXP-2639] Keep APM process agent test case with version < 7.60 trigger Instead of deleting the test that validates ProcessAgent is required when process checks don't run in core agent, change the trigger from envvar override to agent version 7.59 (below the 7.60 minimum). Co-Authored-By: Claude Opus 4.6 (1M context) --- .../datadogagent/feature/apm/feature_test.go | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/internal/controller/datadogagent/feature/apm/feature_test.go b/internal/controller/datadogagent/feature/apm/feature_test.go index 77142f747..db9605523 100644 --- a/internal/controller/datadogagent/feature/apm/feature_test.go +++ b/internal/controller/datadogagent/feature/apm/feature_test.go @@ -348,6 +348,31 @@ func TestAPMFeature(t *testing.T) { WantConfigure: true, ClusterAgent: testAPMInstrumentationNamespaces(), }, + { + Name: "single step instrumentation with language detection enabled, process check runs in process agent", + DDA: testutils.NewDatadogAgentBuilder(). + WithAPMEnabled(true). + WithAPMHostPortEnabled(true, apiutils.NewInt32Pointer(8126)). + WithAPMUDSEnabled(true, apmSocketHostPath). + WithAPMSingleStepInstrumentationEnabled(true, nil, nil, nil, true, "", nil, ""). + WithAdmissionControllerEnabled(true). + WithComponentOverride( + v2alpha1.NodeAgentComponentName, + v2alpha1.DatadogAgentComponentOverride{ + Image: &v2alpha1.AgentImageConfig{Tag: "7.59.0"}, + }, + ). + Build(), + WantConfigure: true, + ClusterAgent: testAPMInstrumentationWithLanguageDetectionEnabledForClusterAgent(), + Agent: testAPMInstrumentationWithLanguageDetectionForNodeAgent(true, false), + WantDependenciesFunc: func(t testing.TB, store store.StoreClient) { + _, found := store.Get(kubernetes.ClusterRoleBindingKind, "", "-apm-cluster-agent") + if !found { + t.Error("Should have created proper RBAC for language detection") + } + }, + }, { Name: "single step instrumentation without language detection enabled", DDA: testutils.NewDatadogAgentBuilder().