Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions docs/deprecated_configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ 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.

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 `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.
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.

### serviceDiscovery.networkStats
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,7 @@ func TestAPMFeature(t *testing.T) {
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"}},
Image: &v2alpha1.AgentImageConfig{Tag: "7.59.0"},
},
).
Build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down
28 changes: 5 additions & 23 deletions internal/controller/datadogagent/feature/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
package utils

import (
"strconv"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
Expand Down Expand Up @@ -42,28 +40,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)
Comment on lines 47 to +48
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore env override handling for pre-7.78 agents

ShouldRunProcessChecksInCoreAgent now ignores DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED, but spec.override.nodeAgent.env is still applied later by override.PodTemplateSpec, so Agent 7.60–7.77 users who set this env var to false get inconsistent behavior: feature Configure paths (liveprocess/livecontainer/processdiscovery/APM) assume checks run in core agent and may not require the process-agent container, while the runtime env disables core-agent execution. In setups where no other feature requires process-agent, this can disable process/container checks entirely; please keep honoring this override (or strip it from overrides) until operator defaults are on Agent >= 7.78.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config has been officially deprecated since 1.19, so I'm not certain whether we should add complex logic for this edge case.

}

func HasFeatureEnableAnnotation(dda metav1.Object, annotation string) bool {
Expand Down
5 changes: 0 additions & 5 deletions internal/controller/datadogagent/global/otelagentgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading