Closed demsey2 closed 4 years ago
Thanks for the bug report. I'll need to reproduce it but I can already tell you that the current version of the lib doesn't do a good job cleaning up the scope when an exception is thrown like in the example above. AWS is reusing your Lambda instance in subsequent invocations which apparently leads to the scope being reused as well, thus reporting logs from previous invocations. That's something I will need to address in the next update of the lib.
@demsey2 , if you get a chance, I would appreciate you trying serverless-sentry-lib
v2.2.0. I have added an explicit scope.clear()
at the beginning of the Lambda invocation. This should fix the issue you reported but I couldn't verify it myself yet.
@arabold I did a quick test and it looks like it works fine, I am going to test that in production with a larger number of functions if I got any issues I will let you know
thanks
I am having a problem with withSentry wrapper. Not sure if I do something wrong or it's a bug.
If I have a lambda with the following setup
and when I call that lambda first time (cold start), Sentry reports an error and I can see all logs/breadcrumbs fine when I call that lambda again (not a cold start) then in Sentry I can see logs from that invocations and from the previous one. This
To avoid that issue I had to create a new instance of Sentry every time, call init() and scope.clear(), by doing so I am losing integration with serverless-sentry plugin and I had to manually set tags etc.