feat: Support binary based decoding for SNS message attributes#269
Merged
feat: Support binary based decoding for SNS message attributes#269
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
astuyve
commented
Mar 2, 2022
| }, | ||
| ], | ||
| }); | ||
| expect(result).toEqual({ |
Contributor
Author
There was a problem hiding this comment.
Somehow, I forgot to add an expectation to this test 🤦🏻
agocs
approved these changes
Mar 2, 2022
| }, | ||
| ], | ||
| }); | ||
| expect(result).toEqual({ |
11 tasks
8 tasks
6 tasks
robcarlan-datadog
added a commit
to DataDog/dd-trace-dotnet
that referenced
this pull request
Jul 11, 2025
…ction (#7205) ## Summary of changes SNS -> SQS context propagation was broken, as we encode the value of the `_datadog` header into base64. On the consume side, we assume it is written as a string, which is only true if we send a message directly through SQS. The fix is to decode the `_datadog` value based on the type, just as in [this](DataDog/datadog-lambda-js#269) PR. This soles issues where the DSM map doesn't show links between SNS and SQS, as the checkpoint is still created on the consumer, just without a link to the parent. ## Reason for change ## Implementation details ## Test coverage I tested this via system-tests, with a description of my test methodology in [this PR](DataDog/system-tests#4897). The SNS system test above pass when I ran locally with this tracer build. ## Other details <!-- Fixes #{issue} --> <!--⚠️ Note: where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. -->
chojomok
pushed a commit
to DataDog/dd-trace-dotnet
that referenced
this pull request
Jul 15, 2025
…ction (#7205) ## Summary of changes SNS -> SQS context propagation was broken, as we encode the value of the `_datadog` header into base64. On the consume side, we assume it is written as a string, which is only true if we send a message directly through SQS. The fix is to decode the `_datadog` value based on the type, just as in [this](DataDog/datadog-lambda-js#269) PR. This soles issues where the DSM map doesn't show links between SNS and SQS, as the checkpoint is still created on the consumer, just without a link to the parent. ## Reason for change ## Implementation details ## Test coverage I tested this via system-tests, with a description of my test methodology in [this PR](DataDog/system-tests#4897). The SNS system test above pass when I ran locally with this tracer build. ## Other details <!-- Fixes #{issue} --> <!--⚠️ Note: where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. -->
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
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?
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:
Additional Notes
Types of Changes
Check all that apply