You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to use a binary type attribute because even a well-formatted JSON string breaks message attribute filtering in AWS SNS, and AWS has no plans to change this (please feel free to open a support ticket in AWS and mention me by name, maybe that will spur their motivation?). The reason is that SNS message filtering is not supported for Binary typed message attributes, so these are passed with no issues.
I'm not familiar with this library, is there a way to ask it not to deserialize this payload? Alternatively you can try disabling raw message delivery, which should strip out the sns metadata, or disable the aws sdk upstream with DD_TRACE_DISABLED_INSTRUMENTATIONS=aws-sdk. This will prevent trace injection into these messages at all.
If you still want trace context passed through SNS and SQS and to use the amazon-sqs-java-messaging-lib, you may need to inject and extract trace context yourself.
We're exploring other methods of trace context injection, but don't have immediate plans at the moment.
Expected behaviour
Actual behaviour
1 & 2 function properly
Step 3 fails with an error "JMSException: Binary is not a supported JMS property type" thrown by this code in the aws library
https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/4cb91355cb92d9361a2179233c9db89383b1299e/src/main/java/com/amazon/sqs/javamessaging/message/SQSMessage.java#L1057
The issue appears to be that when a message is sent to an SNS topic the DataType is set to "Binary"
https://github.com/DataDog/dd-trace-js/blob/da4b19df5e5b7f85f56873372869d677d60d389e/packages/datadog-plugin-aws-sdk/src/services/sns.js#L76C26-L76C26
Which causes the error in the previous code link.
In the SQS version of the code it uses a DataType of "String":
dd-trace-js/packages/datadog-plugin-aws-sdk/src/services/sqs.js
Line 164 in da4b19d
It looks like it's using Binary because of some sort of Message Attribute filtering issue
DataDog/serverless-plugin-datadog#232 (comment)
Steps to reproduce
Environment
Linux AWS ECS Fargate
Linux
18
4.12
https://github.com/DataDog/datadog-agent
The text was updated successfully, but these errors were encountered: