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

When lambda times out, no custom subsegments are seen #265

Open
kjpgit opened this issue Aug 12, 2022 · 3 comments
Open

When lambda times out, no custom subsegments are seen #265

kjpgit opened this issue Aug 12, 2022 · 3 comments
Assignees

Comments

@kjpgit
Copy link

kjpgit commented Aug 12, 2022

I have a lambda that I am purposefully stress testing to time out after 20 seconds.

What I want.

  • The ability to see started custom subsegments and their annotations (user_id, requested_path, sql query text, etc.) so I know what caused the timeout

What happens:

  • I see nothing in xray console except the 2 default lambda segments (and I can't add any annotations to these, so they are useless for me)
  • I see no doc on how to resolve this.
  • Is there a way for the xray client to flush its data, a few seconds before lambda is about to time out?
@jj22ee
Copy link
Contributor

jj22ee commented Aug 17, 2022

Hi @kjpgit

This is a known issue. When a lambda function times out, the function runtime is immediately frozen so that no further operations are possible, thus it’s too late for additional custom subsegments to be exported. However, Lambda is working on an extension to improve this experience.

Please see this similar issue.

Is there a particular reason why you want the xray data to be flushed before the lambda is about to time out? This may not be possible as per our documentation, "the daemon process is fully managed by Lambda and cannot be configured by the user".

@kjpgit
Copy link
Author

kjpgit commented Aug 17, 2022

Is there a particular reason why you want the xray data to be flushed before the lambda is about to time out?

Not sure why this isn't obvious? All code in the lambda, including the xray sdk/client, knows the deadline at which it will become frozen, so it could attempt to flush buffers right before then... e.g. all segments could be written over the socket to the xray daemon or service.

Otherwise I will have created (open) subsegments that will never be seen, in situations precisely when they would help to identify the problem, which is the point of this ticket. btw, we are also using the lambda insights layer.

@jj22ee
Copy link
Contributor

jj22ee commented Aug 17, 2022

Thank you for the clarification. As this currently remains an issue that Lambda is working on improving, I've labeled this as an enhancement request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants