5

I would like to chain two lambda function calls in the xray service map to visualize the connections between the function calls and get the overall execution time. My lambda functions are being called by step functions. When enabling active tracing I see the individual functions in the service map but there is no connections between them.

_X_AMZN_TRACE_ID: Contains the tracing header, which includes the sampling decision, trace ID, and parent segment ID. (To learn more about these properties, see Tracing Header.) If Lambda receives a tracing header when your function is invoked, that header will be used to populate the _X_AMZN_TRACE_ID environment variable. If a tracing header was not received, Lambda will generate one for you.

https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html

_X_AMZN_TRACE_ID seems to contain the relevant information. My question is, how can I use it to establish a connection between two lambda function calls (being called by step functions)?

lenawal
  • 143
  • 7

2 Answers2

5

Step Functions X-Ray trace context propagation isn’t yet supported so there isn’t a way to chain your lambda functions together if they are being called by Step Functions. We are working on this feature but don’t currently have an ETA.

  • 2
    well that is pretty bad, since step functions are probably one of the few things X-Ray would be most useful – Matteo Jan 12 '20 at 09:06
1

X-Ray integration is added to AWS Step Function: https://aws.amazon.com/blogs/compute/introducing-aws-x-ray-new-integration-with-aws-step-functions/

You can enable X-Ray tracing when creating a new state machine by selecting Enable X-Ray tracing on the Specify details page. In the case that state machine gets call from upper service with X-Ray enabled, state machine automatically continue the trace. And for all Task states in state machine, subsegments will be added tp the trace.

Pooya Paridel
  • 1,261
  • 5
  • 10
  • @10Repsaysgetvaccinated Now is this not an Answer? It says that it's now supported with a link as reference. – Scratte Jan 04 '21 at 21:36
  • @Scratte fair enough, I retracted my flag. – 10 Rep Jan 04 '21 at 21:38
  • @10Repsaysgetvaccinated I agree with you, I saw that there was no up to date answer fir the question and I tried to fill the gap. However as you mentioned I can add more detail to make my answer more useful (What I'll do after work) – Pooya Paridel Jan 04 '21 at 21:47
  • @PooyaParidel That's great! – 10 Rep Jan 04 '21 at 21:48