[dotnet] Implement .NET system test for SNS#4897
Merged
robcarlan-datadog merged 11 commits intomainfrom Jul 11, 2025
Merged
Conversation
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. -->
Contributor
Author
|
Failing tests are for other languages |
|
|
||
| topic = self.topic if context.library == "java" else f"arn:aws:sns:us-east-1:{AWS_ACCT}:{self.topic}" | ||
| arn = f"arn:aws:sns:us-east-1:{AWS_ACCT}:{self.topic}" | ||
| topic = self.topic if context.library in ["java", "dotnet"] else arn |
Contributor
Author
There was a problem hiding this comment.
The SNS api for .NET & Java allow sending messages just by topic name, can't deduce full ARN for these tracers
| } | ||
| } | ||
|
|
||
| class SnsProducer |
Contributor
Author
There was a problem hiding this comment.
This practically follows the Java implementation as close as possible
gitstevenpham
approved these changes
Jul 11, 2025
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.
Motivation
SNS implementation was broken in .NET, and is fixed by
DataDog/dd-trace-dotnet#7205
Before this fix (hence the tests fail before the PR merges). we failed to extract parent context, and so the checkpoint on the consume side doesn't have a parent. This explains why we never saw a link between the services in the DSM map.
Failing test output, before:
I ran system-tests locally with a tracer from the above PR, and saw that the checkpoints are now connected:
Latest CI check on the .NET Dev INTEGRATIONS_AWS scenario:
Changes
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
[<language>], double-check that only<language>is impacted by the changebuild-XXX-imagelabel is present