1

I am experimenting with Lambdas and I am having a hard time passing traces from a Lambda to a Step Function which has a lambda within it.

So structure looks something like this:

Lambda Code call step function -> Step function -> Lambda.

Problem is that I am getting two different traces, instead of the desired one trace, which effectively captures lambda -> step function -> lambda all under one trace id.

1st trace - Lambda A 2nd trace - Step Function -> Lambda B

Is this possible to unify the traces, so it looks like this?

Trace 3 - Lambda A -> Step Function -> Lambda B (TraceId: 1) ~ Something like that

And if so how would I go about doing that.

Thanks

vampyfreak
  • 21
  • 1
  • 7

1 Answers1

0

Are you passing the trace header with value of Lambda A trace ID when invoking the State Machine? See https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html

traceHeader Passes the AWS X-Ray trace header. The trace header can also be passed in the request payload.

Milan Gatyás
  • 2,509
  • 1
  • 17
  • 23
  • Yes I am, and I have enabled tracing on step function but the graphs still arent connected. Am I supposed to use "Active" for tracing mode for both lambdas? Tracing is enabled for all of our resources right now. – vampyfreak Apr 14 '22 at 01:40
  • AFAIK active tracing is not required and having it enabled it okay too. Can you also share how the traceHeader value content looks like? – Milan Gatyás Apr 14 '22 at 07:22
  • You should be also able to use X-ray client in your code that can propagate trace headers automatically, example for .net https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-dotnet-sdkclients.html, nodejs https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-awssdkclients.html – Milan Gatyás Apr 14 '22 at 07:29