-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Following the documentation and using Datadog::Lambda.wrap, we always seem to have a separate aws.lambda trace.
When the Lambda function is called with distributed tracing headers, the trace continues as expected.
However the first Datadog::Tracing.trace call does not become a child trace of the aws.lambda trace, instead being a direct child of the original continued trace ID.
So in Datadog we end up seeing 2 separate traces.
Is it possible to inherit from the trace started by the listener on_start ?
It doesn't seem to be the active trace.
Expected Behavior
Being able to see a single parent trace when a Lambda function is invoked.
Actual Behavior
With distributed tracing, traces started after Datadog::Lambda.wrap are always separate from the wrapping trace.
Steps to Reproduce the Problem
- Invoke a Lambda function with event object containing
"headers"and injected Datadog headers.
In our case we just do something like this:
Datadog::Tracing.trace(trace_name) do |_span, trace|
headers = {}
Datadog::Tracing::Contrib::HTTP.inject(trace.to_digest, headers)
client = Aws::Lambda::Client.new
client.invoke({
...
payload: JSON.generate({ headers: headers, ... })
})
end- In the Lambda handler, wrap and start a trace:
Datadog::Lambda.wrap(event, context) do
Datadog::Tracing.trace("do the thing") do
...
end
{ statusCode: 200, body: 'Hello World' }
endSpecifications
- Datadog Lambda Layer version: 3.27.0
- Datadog Lambda extension v92
- Ruby version: 3.4.8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels