-
Notifications
You must be signed in to change notification settings - Fork 388
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
[CLOUDS-4012] Fix service tag setting in lambda forwarder #714
Merged
Conversation
This file contains 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
tyrcho
reviewed
Nov 29, 2023
tyrcho
reviewed
Dec 1, 2023
If the service tag in set in dd_tags use it, otherwise use the one coming from the logGroup If none of the above, check if the tag is set on the lambda forwarder and use it, otherwise use the function name. Finally, check if the service tag is set in the application level and override
ALso: - Update Itests - Add __init__.py to create a package for running utests inside the IDE
…tags Override the service tag if it exists. Merge upper level ddtags and message ddtags in one string.
ge0Aja
force-pushed
the
georgi.ajaeiya/clouds-4012
branch
from
December 4, 2023 14:36
ee43fac
to
379dd1e
Compare
tyrcho
approved these changes
Dec 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Fixing a bug related to service tag setting in the lambda forwarder
This PR fixes the precedence of setting the service tag from multiple sources and removes the redundancy when having multiple values for the service tag from these sources.
The order of priority for setting the service tag is as follows:
message
field in the log if it has a custom tags field set i.e.message.ddtags
ddtags
env var in the lambda logs forwarderddsource
if non of the above is setPreviously the forwarder appended all the values set for the service from all sources in the custom tags field which created a confusion between the actual value of the service key in the log and the appended values in the custom tags field.
This PR removes the redundant values based on the above priorities and ensures that the service key is set according to the value of the highest priority.
Motivation
https://datadoghq.atlassian.net/browse/CLOUDS-4012
Testing Guidelines
Additional Notes
Types of changes
Check all that apply