-
Notifications
You must be signed in to change notification settings - Fork 27
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
All shutdown events are reported with a failure outcome #411
Comments
@julianolf Thanks for opening the issue and the investigation.
This is unexpected however, I am not sure if marking all pending transactions as non-failure is optimal when we receive the
|
I found a probable bug that might explain this case. Currently, the extension processes the shutdown event without flushing available data (ref). Due to this, it is possible that the transactions in the buffer are marked as failed (as the |
I completely agree.
The Python version from the public Lambda Layer:
I can see you are already working on a solution, but if it still helps I can link here for you, just let me know. |
Great! I will keep following along. Let me know if I can be of any help. |
@julianolf I have a fix in progress: https://github.com/elastic/apm-aws-lambda/pull/412/files. This seems to fix the case I mentioned earlier. Would it be possible for you to test the branch to check if it fixes the issue you are facing too? You can follow the below steps:
|
Of course, I'm doing it right away. |
@lahsivjar it seems it's fixed! It took me quite some time to make sure because the behavior now is a little different. The spindown event is not being sent to Elastic anymore, it appears on CloudWatch logs though. I wanted to make sure that timeout and failure events were still being tracked, and they are. So everything looks good. I've published here on GitHub my test project in case you want to check it out by yourself. Thanks for looking at this in such a short time! |
Thanks for testing.
Do you mean transactions with |
APM AWS Lambda extensiom version (
elastic-apm-extension-ver-1-5-0-x86_64
):Describe the bug
When AWS Lambda service sends a shutdown event to a function the extension captures it and no matter the reason for the shutdown the event outcome is set as
failure
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Elastic receives transactions where the
event.outcome
isfailure
and thetransaction.result
isspindown
.Provide logs (if relevant): https://gist.github.com/julianolf/33dcd000be2363300879e434080b4c7f
Assumption
I believe the previous versions of the extension wasn't actually handling the shutdown event, this started to happen after upgrading to version 1.5 and it seems to be related to some working in progress related to this issue #118.
According to AWS documentation there are three possibilities for a shutdown,
spindown
is just a normal shutdown.As a temporary fix I've patched this single line.
PS.
If my steps to reproduce are too vague I can provide a small example projecto using AWS SAM to help easily reproduce what I've described.
Also, I could help on fixing it if it makes sense and you guys are willing to give some orientation on how to proceed, just let me know.
The text was updated successfully, but these errors were encountered: