aws-samples / pcluster-manager

Manage AWS ParallelCluster through an easy to use web interface
https://pcluster.cloud
Apache License 2.0
65 stars 27 forks source link

Add stacktraces to Lambda logs #426

Closed mtfranchetto closed 1 year ago

mtfranchetto commented 1 year ago

Description

Print the complete stacktrace when logging an error on CW.

Although it's not ideal to have each stacktrace entry on a separate line (and I thought this was an issue) it's actually the behavior of the Python Lambda runtime, and cannot be changed (more details here). This can behavior can be overcome by going through Logs Insights first to find the log stream and time of the error, then visiting the full log stream to see the stacktrace.

How Has This Been Tested?

Screenshot 2022-12-21 at 12 46 33

References

PR Quality Checklist

In order to increase the likelihood of your contribution being accepted, please make sure you have read both the Contributing Guidelines and the Project Guidelines

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

mtfranchetto commented 1 year ago

Approved, the only thing I would keep in mind is that, if running still in an except clause, we could use logger.error again and print info about a previously caught exception even if that's not the intention

Makes sense, but this case is not that relevant to change the implementation right now. By the way, let's keep an eye and, if that happens, let's figure out how to change the logger.