-
Notifications
You must be signed in to change notification settings - Fork 439
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
appsec: add tracer start option for appsec enablement #2966
Conversation
Adds a new tracer start option that allows to explicitly enable or disable appsec, overriding the default activation criteria (from `DD_APPSEC_ENABLED` and remote configuration).
@@ -660,7 +664,7 @@ func loadAgentFeatures(agentDisabled bool, agentURL *url.URL, httpClient *http.C | |||
} | |||
defer resp.Body.Close() | |||
type agentConfig struct { | |||
defaultEnv string `json:"default_env"` | |||
DefaultEnv string `json:"default_env"` |
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.
NB - This was previously broken; as the json
package cannot do anything with non-exported fields...
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.
Good catch.
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.
LGTM
BenchmarksBenchmark execution time: 2024-11-06 17:42:14 Comparing candidate commit 855a63d in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 0 unstable metrics. |
@@ -660,7 +664,7 @@ func loadAgentFeatures(agentDisabled bool, agentURL *url.URL, httpClient *http.C | |||
} | |||
defer resp.Body.Close() | |||
type agentConfig struct { | |||
defaultEnv string `json:"default_env"` | |||
DefaultEnv string `json:"default_env"` |
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.
Good catch.
What does this PR do?
Adds a new tracer start option that allows to explicitly enable or disable appsec, overriding the default activation criteria (from
DD_APPSEC_ENABLED
and remote configuration).Motivation
There is a use-case in https://github.com/DataDog/datadog-agent where a tracer is started but AppSec features are undesirable (and unsupported) in this context. Explicitly disabling AppSec features allows to avoid emitting an AppSec startup error message when the agent's environment includes
DD_APPSEC_ENABLED=true
.Reviewer's Checklist
Unsure? Have a question? Request a review!