Skip to content
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

feat: Support binary based decoding for SNS message attributes #269

Merged
merged 4 commits into from
Mar 3, 2022

Conversation

astuyve
Copy link
Contributor

@astuyve astuyve commented Mar 2, 2022

What does this PR do?

Fixes DataDog/serverless-plugin-datadog#232

TODO: Bump linked version of dd-trace in this PR

Motivation

Although AWS documentation claims that string values are supported, AWS support has told us that stuffing JSON into a string is not supported, and breaks filter policies entirely. These messages are not rejected, and are successfully delivered to recipients without a filter policy, so they fail silently.

This change is backwards compatible, so users still relying on DD trace 2.1 can use this version.

Testing Guidelines

I created a test app that publishes to a topic and contains an SQS subscription with a filter policy. I've verified that these changes combined with my changes in dd trace js (DataDog/dd-trace-js#1889) properly propagate trace context and are not subject to filter policies:

image

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@astuyve astuyve requested a review from a team as a code owner March 2, 2022 17:15
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2022

Codecov Report

Merging #269 (e74f9f9) into main (4306bfd) will increase coverage by 0.08%.
The diff coverage is 100.00%.

❗ Current head e74f9f9 differs from pull request most recent head dda6a76. Consider uploading reports for the commit dda6a76 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
+ Coverage   82.75%   82.84%   +0.08%     
==========================================
  Files          37       37              
  Lines        1618     1626       +8     
  Branches      349      351       +2     
==========================================
+ Hits         1339     1347       +8     
  Misses        231      231              
  Partials       48       48              
Impacted Files Coverage Δ
src/trace/context.ts 85.40% <100.00%> (+0.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4306bfd...dda6a76. Read the comment docs.

@@ -283,6 +325,42 @@ describe("readTraceFromEvent", () => {
},
],
});
expect(result).toEqual({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow, I forgot to add an expectation to this test 🤦🏻

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

@astuyve astuyve requested review from hghotra and agocs March 2, 2022 17:26
@@ -283,6 +325,42 @@ describe("readTraceFromEvent", () => {
},
],
});
expect(result).toEqual({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

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.

The new tracing enhancement seems to break filtered SNS/SQS subscriptions
3 participants