Skip to content

feat: Add support for DD_LOGS_ENABLED as alias for DD_SERVERLESS_LOGS_ENABLED#928

Merged
litianningdatadog merged 1 commit into
mainfrom
tianning.li/SVLS-7818-respect-DD_LOGS_ENABLED
Nov 24, 2025
Merged

feat: Add support for DD_LOGS_ENABLED as alias for DD_SERVERLESS_LOGS_ENABLED#928
litianningdatadog merged 1 commit into
mainfrom
tianning.li/SVLS-7818-respect-DD_LOGS_ENABLED

Conversation

@litianningdatadog

@litianningdatadog litianningdatadog commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

https://datadoghq.atlassian.net/browse/SVLS-7818

Overview

Add DD_LOGS_ENABLED environment variable and YAML config option as an alias for DD_SERVERLESS_LOGS_ENABLED. Both variables now use OR logic, meaning logs are enabled if either variable is set to true.

Changes:

  • Add logs_enabled field to EnvConfig and YamlConfig structs
  • Implement OR logic in merge_config functions: logs are enabled if either DD_LOGS_ENABLED or DD_SERVERLESS_LOGS_ENABLED is true
  • Add comprehensive test coverage with 9 test cases covering all combinations of the two variables
  • Maintain backward compatibility with existing configurations
  • Default value remains true when neither variable is set

Testing

Set DD_LOGS_ENABLED and DD_SERVERLESS_LOGS_ENABLED to false and expect:

Otherwise the log should be available in DD console.

@litianningdatadog
litianningdatadog marked this pull request as ready for review November 13, 2025 20:26
@litianningdatadog
litianningdatadog requested a review from a team as a code owner November 13, 2025 20:26
@litianningdatadog
litianningdatadog force-pushed the tianning.li/SVLS-7818-respect-DD_LOGS_ENABLED branch from d4b6766 to 0f02887 Compare November 24, 2025 14:59
@litianningdatadog
litianningdatadog merged commit 94315bf into main Nov 24, 2025
39 checks passed
@litianningdatadog
litianningdatadog deleted the tianning.li/SVLS-7818-respect-DD_LOGS_ENABLED branch November 24, 2025 15:15
duncanpharvey pushed a commit that referenced this pull request Mar 10, 2026
…_ENABLED (#928)

https://datadoghq.atlassian.net/browse/SVLS-7818

  ## Overview
Add DD_LOGS_ENABLED environment variable and YAML config option as an
alias for DD_SERVERLESS_LOGS_ENABLED. Both variables now use OR logic,
meaning logs are enabled if either variable is set to true.

  Changes:
  - Add logs_enabled field to EnvConfig and YamlConfig structs
- Implement OR logic in merge_config functions: logs are enabled if
either DD_LOGS_ENABLED or DD_SERVERLESS_LOGS_ENABLED is true
- Add comprehensive test coverage with 9 test cases covering all
combinations of the two variables
  - Maintain backward compatibility with existing configurations
  - Default value remains true when neither variable is set


## Testing 
Set DD_LOGS_ENABLED and DD_SERVERLESS_LOGS_ENABLED to false and expect:
- [Log can be found in AWS
console](https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Flambda$252Fltn-fullinstrument-bn-cold-node22-lambda/log-events/2025$252F11$252F13$252F$255B$2524LATEST$255D455478dcbc944055b5be933e2e099f6a$3FfilterPattern$3DREPORT+RequestId)
- [Log could NOT be found in DD
console](https://ddserverless.datadoghq.com/logs?query=source%3Alambda%20%40lambda.arn%3A%22arn%3Aaws%3Alambda%3Aus-east-1%3A425362996713%3Afunction%3Altn-fullinstrument-bn-cold-node22-lambda%22%20AND%20%22REPORT%20RequestId%22&agg_m=count&agg_m_source=base&agg_t=count&clustering_pattern_field_path=message&cols=host%2Cservice%2C%40lambda.request_id&fromUser=true&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=desc&viz=stream&from_ts=1763063694206&to_ts=1763065424700&live=false)

Otherwise the log should be available in DD console.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants