Closed bajajyog closed 11 months ago
The behavior that you report is as intended (though we acknowledge how it might come across as confusing). The runtime catches the error thrown by your function handler, and reports this error as described in Runtime API invoke error behavior as described here. From the Runtime’s perspective, this request executed successfully (i.e. did not crash, timeout, or exit), hence status=success. We’re evaluating ways to better surface errors that occur in function code, but don’t currently have a timeline for it. Hope this helps, and let me know if you have any other questions.
We have built a Java Lambda extension and subscribing to telemetry api to push logs to splunk. An explicit exception is thrown in lambda to check telemetry api show status as failure for Lambda exception in the platform.runTimeDone event.
AWS lambda Telemetry api msgs:-
{ "time": "2023-06-11T17:03:14.843Z", "type": "function", "record": "exception: .infrastructure.exception.ServerlessException\ncom.infrastructure.exception.ServerlessException: exception\ .... } , { "time": "2023-06-11T17:03:14.843Z", "type": "platform.runtimeDone", "record": { "requestId": "777ff55f-e84c-41f8-ae9f-53f541f01a60", "status": "success", "metrics": { "durationMs": 78.656, "producedBytes": 0 } } }
Please advise, why platform.runtimeDone event status is success instead of failure for explicit exception in lambda or please advise in. which cases of invocation failure we will get status as failure in platform.runtimeDone event.