-
Notifications
You must be signed in to change notification settings - Fork 393
refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only log message #996
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
refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only log message #996
Conversation
…gainst JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]>
… done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]>
| logs_to_forward = filter_logs( | ||
| logs_to_forward, INCLUDE_AT_MATCH, EXCLUDE_AT_MATCH | ||
| ) | ||
| if matcher.match(evaluated_log): |
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.
We should properly catch the exception raised by the matcher here and maybe log a warn?
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 previous behavior was to catch the exception and raise a new one. I think it's better to crash in this case. Otherwise Lambda will "succeed" but with bad filtering which is hidding a problem.
ge0Aja
left a comment
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, minor comment about exception handling
…gainst JSON, now only log message (#996) * refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]> * fixup! refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]>
…gainst JSON, now only log message (#996) * refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]> * fixup! refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]>
…gainst JSON, now only log message (#996) * refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]> * fixup! refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]>
* refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only log message (#996) * refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]> * fixup! refactor(aws)!: AWSX-1703 Change matching of regex. Previously done against JSON, now only on log Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]> * feat(aws)!: Drop deprecated TCP support (#1000) Signed-off-by: Vincent Boutour <[email protected]> * feat(aws)!: Remove deprecated PrivateLink env variable (#1002) Signed-off-by: Vincent Boutour <[email protected]> * docs(aws): Removing JSON explanation in the include at match documentation (#1007) Signed-off-by: Vincent Boutour <[email protected]> * Add environment variable to support backend storage tag enrichment (#1006) * feat(aws): AWSX-1566 Adding storage tag HTTP header Signed-off-by: Vincent Boutour <[email protected]> * feat(aws): AWSX-1566 Adding new variable in the cloudformation template Signed-off-by: Vincent Boutour <[email protected]> * feat: AWSX-1566 Restoring fetch in the integration test to see metrics Signed-off-by: Vincent Boutour <[email protected]> * fixup! feat: AWSX-1566 Restoring fetch in the integration test to see metrics Signed-off-by: Vincent Boutour <[email protected]> * docs(aws): AWSX-1566 Refine documentation around the new variable Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]> * fix(aws): Fixing discrepancies of the fetch configuration between cloudformation and code Signed-off-by: Vincent Boutour <[email protected]> * feat: Add a changelog for the v5 (#1009) * feat: Add a changelog for the v5 Signed-off-by: Vincent Boutour <[email protected]> * fixup! feat: Add a changelog for the v5 Signed-off-by: Vincent Boutour <[email protected]> * Update aws/logs_monitoring/CHANGELOG.md Co-authored-by: Raphaël Allier <[email protected]> * fixup! Update aws/logs_monitoring/CHANGELOG.md Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]> Co-authored-by: Raphaël Allier <[email protected]> * Update aws/logs_monitoring/CHANGELOG.md Co-authored-by: Georgi <[email protected]> * Update aws/logs_monitoring/CHANGELOG.md Co-authored-by: Georgi <[email protected]> * Update aws/logs_monitoring/CHANGELOG.md Co-authored-by: Georgi <[email protected]> * Update aws/logs_monitoring/CHANGELOG.md Co-authored-by: Georgi <[email protected]> * Update aws/logs_monitoring/CHANGELOG.md Co-authored-by: Georgi <[email protected]> * docs: Updating changelog from comments Signed-off-by: Vincent Boutour <[email protected]> * fixup! docs: Updating changelog from comments Signed-off-by: Vincent Boutour <[email protected]> * Add reference to the changelog in README (for public doc) (#1011) * feat: Add link to the changelog in the read toe reflect the documentation The readme is feeding this page https://docs.datadoghq.com/logs/guide/forwarder/?tab=cloudformation Signed-off-by: Vincent Boutour <[email protected]> * fixup! feat: Add link to the changelog in the read toe reflect the documentation Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]> * refactor: Improve error handling for exception (#1012) * refactor: Improve error handling for exception Signed-off-by: Vincent Boutour <[email protected]> * fixup! refactor: Improve error handling for exception Signed-off-by: Vincent Boutour <[email protected]> * fixup! refactor: Improve error handling for exception Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]> * Update aws/logs_monitoring/lambda_function.py Co-authored-by: Georgi <[email protected]> * fixup! Update aws/logs_monitoring/lambda_function.py Signed-off-by: Vincent Boutour <[email protected]> --------- Signed-off-by: Vincent Boutour <[email protected]> Co-authored-by: Raphaël Allier <[email protected]> Co-authored-by: Georgi <[email protected]>
What does this PR do?
Fix a behavior of running the
INCLUDE_AT_MATCHandEXCLUDE_AT_MATCHagainst the JSON dump of the log being sent to Datadog instead of the log as received.This is a BREAKING CHANGE if regexes where defined for JSON escaped string.
Previously, filtering a the
statusfield of a JSON log was possible like thisNow, it will be like this
Motivation
The Regex was hard to reason about. Searching for the regex in a log file was working but not in the forwarder, this leaded to some support from customers.
Testing Guidelines
Additional Notes
Types of changes
Check all that apply