Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing lambda spans when called from distributed map in step functions #268

Open
adatob opened this issue Jun 10, 2024 · 5 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@adatob
Copy link

adatob commented Jun 10, 2024

Hi,

I'm struggling with the problem of missing spans in DataDog when calling a lambda function from a step function where distributed maps are in use. Considering the AWS developer guide there is an information that Step Functions doesn't support X-Ray tracing for the child workflow executions started by a Distributed Map state.
I am still able to re-enable X-Ray tracing by creating a new segment inside the function, however such traces are not pulled by the DD - X-Ray integration. Moreover the child spans created with the dd-trace tracer are not visible anymore.
Only spans created by the extension layer are still visible in DD: one or two depending on the cold start.

With the manual lambda invocation the spans created and all associated X-Ray traces are visible id DD.

I wonder if there is any alternative solution that:

  1. Make the traces created by the new X-Ray segment visible to DD.
  2. will allow you to create new dd-trace spans and associate them with a given lambda call by SF

current environment details:

  • GO 1.22
  • Datadog-Extension:51 - (I will bump it soon and then confirm the issue)
  • enabled active X-Ray tracing
  • enabled DataDog - X-Ray integration,
  • DD_MERGE_XRAY_TRACES set to true

I will be grateful for the community's support on this topic,

Adam.

@agocs
Copy link
Contributor

agocs commented Jun 10, 2024

Hi Adam,
Unforuntately, Datadog also can't trace across a distributed map state. The distributed map state doesn't pass enough context to the lambda function to be able to reconstruct a trace ID. Distributed map states also result in, theoretically, very wide traces, which presents a problem for both X-Ray and our APM system. Both of these are problems we are working to solve, but I suspect it won't be quick.

If you send an email to [email protected], you can ask them to add you to the feature request for span linking across distributed map states.

Sorry and all the best!
-Chris

@adatob
Copy link
Author

adatob commented Jun 10, 2024

Thanks for the quick response.

I fully accept the argument related to the properties of distributed maps.
However, do you see any way to configure the X-Ray integration to be able to pull the manually created (besides the active tracing) segments, being aware that they may be not correlated with traces created by the Datadog extension or spans created within the step function?

I'm wondering if the lambda traces might be completely independent from step function trace, like for the manual function invocation. In my case this will be even better than nothing.

Best regards,
Adam

@agocs
Copy link
Contributor

agocs commented Jun 25, 2024

Hi @adatob , do you mean something like this?

image

It seems like it should just work. You could use our X-Ray integration or instrument the Lambda functions using datadog instrumentation, whatever you want.

@nine5two7
Copy link
Contributor

nine5two7 commented Jun 25, 2024

Hello. We are currently working with AWS on supporting Distributed MapStates. There have been a couple of sync meetings between AWS and us recently. We need their help to inject some useful data into execution logs so that span linking can be possible.

For the XRay solution, AWS engineers previously told us that it cannot support Distributed MapStates either. XRay is facing the same problem as we are, and it may also have more concerns about the scale of the fan-out.

@xrn
Copy link

xrn commented Oct 6, 2024

Hey @nine5two7 is there any update on above?

@duncanista duncanista added the enhancement New feature or request label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants