Repository navigation
[SVLS-9883] feat: add DD_LOG_LEVEL_BY_TARGET to set log levels per target #1413
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
Open
lym953
wants to merge
14
commits into
yiming.luo/cold-start-duration-logs
Choose a base branch
from
yiming.luo/log-debug-targets
base: yiming.luo/cold-start-duration-logs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fdb365f
[SVLS-9883] Add DD_LOG_DEBUG_TARGETS to enable debug logs per target
lym953 246a2e9
[SVLS-9883] Use trace_flush_duration in the env filter test
lym953 981ee9d
[SVLS-9883] Replace DD_LOG_DEBUG_TARGETS with DD_LOG_LEVEL_BY_TARGET
lym953 16f683a
[SVLS-9883] Document that target names must not be prefixes of each o…
lym953 225e496
[SVLS-9883] Accept filter directives in DD_LOG_LEVEL
lym953 0e706b3
[SVLS-9883] Bump serverless-components for directive-aware DD_LOG_LEVEL
lym953 35ea498
[SVLS-9883] Bump serverless-components to the latest commit of #178
lym953 015e783
[SVLS-9883] Bump serverless-components to the rebased #178
lym953 bf67a21
[SVLS-9883] Go back to DD_LOG_LEVEL_BY_TARGET
lym953 6f1eab7
[SVLS-9883] Accept only target=level entries in DD_LOG_LEVEL_BY_TARGET
lym953 e47df3c
[SVLS-9883] Use datadog-serverless-logging for DD_LOG_LEVEL_BY_TARGET
lym953 c2aa611
[SVLS-9883] Drop the DD_LOG_LEVEL_BY_TARGET notes from the target con…
lym953 f9fd99a
[SVLS-9883] Bump serverless-components to the merge commit of #180
lym953 fcb610e
[SVLS-9883] Bring back the note about target names next to the target…
lym953 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The base filter turns off
h2,hyper,reqwestandrustlsfor a reason, and with this change aDD_LOG_LEVEL_BY_TARGETentry can turn them back on. The extension reads its own stdout and sends it to Datadog as logs (see the "Be careful adding logs inside the logs pipeline" note in AGENTS.md). These HTTP crates log on every request, and that includes the requests the extension makes to send logs. So withhyper=debug, every flush creates more log lines, which get sent in the next flush, which creates more lines, and so on. That adds a lot of noise to the customer's CloudWatch and Datadog logs, and it costs them money.Since this is an environment variable customers can set, I'd keep those four crates locked to
off. You can skip any entry for them and add it toinvalid_entries, so the user gets the same warning as for a typo. The cleanest place for this is probably the crate in serverless-components#180, for example by letting the caller pass a list of targets that can't be changed. That would mean making the change before #180 merges. Theoverrides_base_filtertest that setsh2=debugwould then change to check that the entry is rejected.