-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PROCS-3710] Add ability to run Processes features on Core Agent #1121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not contain a valid label. Please add one of the following labels: bug, enhancement, refactoring, documentation, tooling, dependencies
fea8213
to
27eb10e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## daniel.tafoya/orchestrator-process-agent-container-fix #1121 +/- ##
==========================================================================================
+ Coverage 58.98% 59.21% +0.22%
==========================================================================================
Files 174 174
Lines 21387 21511 +124
==========================================================================================
+ Hits 12616 12737 +121
- Misses 8004 8006 +2
- Partials 767 768 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
containerName := apicommonv1.ProcessAgentContainerName | ||
runInCoreAgent := f.runInCoreAgentCfg != nil && f.runInCoreAgentCfg.enabled | ||
if runInCoreAgent { | ||
containerName = apicommonv1.CoreAgentContainerName | ||
} | ||
runInCoreAgentEnvVar := &corev1.EnvVar{ | ||
Name: apicommon.DDProcessConfigRunInCoreAgent, | ||
Value: apiutils.BoolToString(&runInCoreAgent), | ||
} | ||
managers.EnvVar().AddEnvVarToContainer(apicommonv1.ProcessAgentContainerName, runInCoreAgentEnvVar) | ||
managers.EnvVar().AddEnvVarToContainer(apicommonv1.CoreAgentContainerName, runInCoreAgentEnvVar) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any good place to put util functions that are shared between certain features? Lot of shared code could be reduced.
// RunInCoreAgent controls enablement of running the feature in the core agent. | ||
// +optional | ||
RunInCoreAgent *ProcessesRunInCoreAgent `json:"runInCoreAgent,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be better to have one top level configuration for this to avoid having to handle inconsistent values as it adds a lot of logic. Is there a good way to do that? It seemed to be against the standard convention to do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple small docs edits
@@ -96,7 +96,9 @@ spec: | |||
| features.kubeStateMetricsCore.conf.configMap.name | Name is the name of the ConfigMap. | | |||
| features.kubeStateMetricsCore.enabled | Enabled enables Kube State Metrics Core. Default: true | | |||
| features.liveContainerCollection.enabled | Enables container collection for the Live Container View. Default: true | | |||
| features.liveContainerCollection.runInCoreAgent.enabled | Enabled enables running parent feature in core agent (experimental) Default: false | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| features.liveContainerCollection.runInCoreAgent.enabled | Enabled enables running parent feature in core agent (experimental) Default: false | | |
| features.liveContainerCollection.runInCoreAgent.enabled | Enabled enables running parent feature in core Agent (experimental). Default: false | |
| features.liveProcessCollection.enabled | Enabled enables Process monitoring. Default: false | | ||
| features.liveProcessCollection.runInCoreAgent.enabled | Enabled enables running parent feature in core agent (experimental) Default: false | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| features.liveProcessCollection.runInCoreAgent.enabled | Enabled enables running parent feature in core agent (experimental) Default: false | | |
| features.liveProcessCollection.runInCoreAgent.enabled | Enabled enables running parent feature in core Agent (experimental). Default: false | |
@@ -124,6 +126,7 @@ spec: | |||
| features.otlp.receiver.protocols.http.enabled | Enable the OTLP/HTTP endpoint. | | |||
| features.otlp.receiver.protocols.http.endpoint | Endpoint for OTLP/HTTP. Default: '0.0.0.0:4318'. | | |||
| features.processDiscovery.enabled | Enabled enables the Process Discovery check in the Agent. Default: true | | |||
| features.processDiscovery.runInCoreAgent.enabled | Enabled enables running parent feature in core agent (experimental) Default: false | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| features.processDiscovery.runInCoreAgent.enabled | Enabled enables running parent feature in core agent (experimental) Default: false | | |
| features.processDiscovery.runInCoreAgent.enabled | Enabled enables running parent feature in core Agent (experimental). Default: false | |
9cf434c
to
3072e4e
Compare
What does this PR do?
This PR adds the ability to run all Processes features on the core agent. A config type,
ProcessesRunInCoreAgent
, is added to all Processes feature types to facilitate this. Because each feature can have its own value set, the source of truth is handled with the following precedence: Live Processes > Live Containers > Process Discovery.Motivation
What inspired you to submit this pull request?
Additional Notes
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
Each feature was tested in both configurations (core agent and process agent) on a local kind cluster.
Live Processes Example:
Process Agent
Results in:
Core Agent
Results in:
Checklist
bug
,enhancement
,refactoring
,documentation
,tooling
, and/ordependencies
qa/skip-qa
label