How to chain lambda function calls in X-Ray service map
Asked Answered
U

2

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)?

Uncut answered 11/3, 2019 at 11:5 Comment(0)
E
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.

Ehlke answered 4/1, 2021 at 21:20 Comment(4)
@10Repsaysgetvaccinated Now is this not an Answer? It says that it's now supported with a link as reference.Shortterm
@Shortterm fair enough, I retracted my flag.Scare
@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)Ehlke
@PooyaParidel That's great!Scare
B
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.

Bankston answered 19/4, 2019 at 18:0 Comment(1)
well that is pretty bad, since step functions are probably one of the few things X-Ray would be most usefulSunday
E
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.

Ehlke answered 4/1, 2021 at 21:20 Comment(4)
@10Repsaysgetvaccinated Now is this not an Answer? It says that it's now supported with a link as reference.Shortterm
@Shortterm fair enough, I retracted my flag.Scare
@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)Ehlke
@PooyaParidel That's great!Scare

© 2022 - 2024 — McMap. All rights reserved.