Skip to content

Automatic Trace Propagation not working for java lambdas via SNS/SQS #1117

@amylouisse

Description

@amylouisse

Describe the bug
I have an event driven system with multiple lambdas, the scenario:

  • Lambda 1 publishes message the SNS topic
  • SNS forwards message to SQS
  • Lambda 2 is triggered via SQS message

The traceID logged in lambda 1 does not match the traceID logged in lambda two. I'd expect to see automatic trace propagation when the lambdas are instrumented correctly. The trace information is set in the AWSTraceHeader but at the moment I have to manually abstract it and set the context myself.

What did you expect to see?
I expected the trace that is logged in lambda 1 to be automatically propagated to lambda two, so I can follow the traces through the event driven system.

What did you see instead?
The traceId in lambda one does not match the traceId in lambda two

What version of collector/language SDK version did you use?
Using the wrapper aws-otel-java-wrapper-amd64-ver-1-32-0:6

What language layer did you use?
Java

Additional context
Both lambdas are using the otel java wrapper layer and
AWS_LAMBDA_EXEC_WRAPPER is set to /opt/otel-sqs-handler
It works fine for Lambda - SNS - SQS - ECS flows when the ECS service is using Otel also, seems only to be an issue with lambdas.

Metadata

Metadata

Assignees

No one assigned

    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