-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Send logs by default from Lambda Extension #8101
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.
@nhinsch When you say in the PR notes, "This is a breaking change', might be worth clarifying it's only a breaking change to the extension, and makes so different to the regular agent.
pkg/config/config.go
Outdated
@@ -828,6 +828,9 @@ func InitConfig(config Config) { | |||
config.BindEnvAndSetDefault("runtime_security_config.remote_tagger", true) | |||
bindEnvAndSetLogsConfigKeys(config, "runtime_security_config.endpoints.") | |||
|
|||
// Serverless Agent | |||
config.BindEnvAndSetDefault("serverless_logs_enabled", true) |
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.
I'm very sorry I've made a typo in my previous comment, that would be: serverless.logs_enabled
...
What does this PR do?
Current behavior:
logs_enabled
config key defaults tofalse
. Setting it totrue
enables the logs agent.logs_enabled
totrue
.New behavior:
serverless.logs_enabled
which defaults totrue
. This is used by the Lambda extension to decide whether or not to send logs to Datadog.Motivation
The vast majority of Lambda extension users will want to send logs to Datadog. We would like this to be the default behavior so that customers can avoid configuring the extension. Because the
logs_enabled
config key is used by the regular agent and defaults tofalse
, the only way to change the default behavior without affecting the regular agent is to create a separate config key for the Lambda extension.As a bonus, this removes confusion that may arise because the
logs_enabled
key previously had a different meaning in the Lambda extension compared to the regular agent.Additional Notes
This is a breaking change for the Lambda extension:
serverless.logs_enabled
config value (which corresponds to theDD_SERVERLESS_LOGS_ENABLED
environment variable).logs_enabled
will now be ignored going forward.I also looked into using
IsSet()
to override the normal default so that we could continue using the samelogs_enabled
environment variable. That is, iflogs_enabled
was not explicitly set to false, we could override the default to true in the Lambda Extension. This did not work becauseisSet()
returns true even when the value is not explicitly set -- a default counts as being "set".Describe how to test your changes
I manually tested this change in the sandbox environment.