I am trying to do custom trace propagation in the following scenario: AWS Lambda -> Event Bridge -> AWS Lambda
The trace of the second lambda function should have the same trace id as the first lambda and the aws.lambda span of the first lambda should be the parent of the seconds aws.lambda span.
Actual Behavior
The datadog-lambda-js picks up the _datadog attribute which is sent to the second lambda as event payload:
{"status":"debug","message":"datadog:Extracted trace context from Custom Extractor","traceContext":{"traceId":"10134166690075585874","sampleMode":2,"source":"event","parentId":"999770304986695473"}}
It also says:
{"status":"debug","message":"datadog:Added trace context to Xray metadata","trace":{"spanContext":{"_traceId":"10134166690075585874","_spanId":"999770304986695473","_parentId":null,"_isFinished":false,"_tags":{},"_sampling":{"priority":"2"},"_baggageItems":{},"_noop":null,"_trace":{"started":[],"finished":[],"tags":{}}},"source":"event"}}
{"status":"debug","message":"datadog:Attempting to find parent for the aws.lambda span"}
However, the next log says it sets another traceId:
Inject into carrier: {"x-datadog-trace-id":"7913624874872765514","x-datadog-parent-id":"7913624874872765514","x-datadog-sampling-priority":"1"}
Is event the proper source mode in my scenario? It is hard to find any documentation on this. It looks like dd-trace just ignores the tracingContext obtained like this.
Expected Behavior
I am trying to do custom trace propagation in the following scenario: AWS Lambda -> Event Bridge -> AWS Lambda The trace of the second lambda function should have the same trace id as the first lambda and the aws.lambda span of the first lambda should be the parent of the seconds aws.lambda span.
Actual Behavior
The datadog-lambda-js picks up the
_datadog
attribute which is sent to the second lambda as event payload:It also says:
However, the next log says it sets another traceId:
The following logs confirms it:
Why isn't the traceId which was obtained by traceExtractor used by the dd-trace library?
I configured the extractor as follows:
Is
event
the proper source mode in my scenario? It is hard to find any documentation on this. It looks like dd-trace just ignores the tracingContext obtained like this.Steps to Reproduce the Problem
-
Specifications