Skip to content

The new tracing enhancement seems to break filtered SNS/SQS subscriptions #232

Closed
DataDog/datadog-lambda-js
#269
@dls314

Description

@dls314

Expected Behavior

Using the new tracing feature doesn't change how my system was working; even if it uses SNS/SQS message filtering

Actual Behavior

When the plugin / lambda layer adds in the SNS message attribute that enables tracing, existing SNS/SQS message filters don't seem to deliver the messages.

Steps to Reproduce the Problem

  1. Using some SNS/SQS filters that worked when using plugin version 3.4.0 and lambda layer version Datadog-Node12-x:66

  2. Update and re-build using plugin version 3.7.1 and lambda layer version Datadog-Node14-x:70

  3. Subscribe something non-filtered to the SNS topic (like an email address)

  4. Run some tests, see non-delivery to SQS that is filtered and delivery to email that is unfiltered and includes the _datadog message attribute

  5. (to confirm) downgrade plugin and re-build/deploy (in progress ). Downgrading the serverless-plugin-datadog to 3.6.0 fixed the issue for me

Specifications

  • Serverless Framework version: 2.30.3
  • Datadog Serverless Plugin version: 3.7.1
    • Datadog Lambda Layer version: Datadog-Node14-x:70
  • Lambda function runtime (Python 3.7, Node 10, etc.): Node 14.x

Stacktrace

No errors are shown, SNS isn't delivering because of something in the filtering. I'm not certain that you're able to put structured text into the SNS string message attribute in the way that this change is doing

I see a message with an attribute like this (taken from a JSON-email delivery, the escaping may be an artifact of that)

"MessageAttributes" : {
    "_datadog" : {"Type":"String","Value":"{\"x-datadog-trace-id\":\"--omitted--\",\"x-datadog-parent-id\":\"--omitted--\",\"x-datadog-sampling-priority\":\"1\",\"x-datadog-tags\":\"_dd.p.upstream_services=--omitted--\"}"},
    // other attributes are omitted here, but present in my testing
 }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions