-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
@sentry/serverless
does not send Error events on crashes (GCP Function)
#3387
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
Comments
@alexbchr Hi Alex, I believe the one of the error log is because of the |
@pravinba9495 Thanks Praveen for the direction! However, the I believe you're kind of right though about the issue coming from This exact issue is described in this issue in the I honestly don't understand how the referenced issue was never fix but |
@alexbchr I tested a similar piece of code. But this time, sentry was able to receive the events. First I thought, may be it was a hit-or-miss scenario. I invoked the http function many times, and all the times, sentry was able to receive them (process still crashes though). The only change I did this time is to re-wrap the import * as Sentry from '@sentry/serverless'
import * as SentryTracing from '@sentry/tracing'
import * as functions from 'firebase-functions';
// Necessary so Sentry doesn't crash on error (because of Webpack tree-shaking)
SentryTracing.addExtensionMethods()
Sentry.GCPFunction.init({
dsn: 'some_dsn_from_sentry',
tracesSampleRate: 1.0,
environment: 'development',
debug: true,
})
const helloHttp = Sentry.GCPFunction.wrapHttpFunction((req, res) => {
let message = req.query.message || req.body.message || 'Hello World!';
throw new Error('oh, hello there!');
res.status(200).send(message);
});
export const httpHandler = functions.https.onRequest(helloHttp); As you can see, I am not explicitly catching exceptions/rejections, just like in your example. Also check The code was tested directly from GCP (deployed via firebase-cli) and not hosted locally. |
@pravinba9495 Thanks for the attempt at it. However, we are using GCP Functions directly (not via Firebase) with the |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Package + Version
Using:
@sentry/serverless@6.2.5
@sentry/tracing@6.2.5
Description
When using
@sentry/serverless
, uncaught exception are not sent to Sentry when hosted on GCP Functions (or when executed locally using@google-cloud/functions-framework
package). Here is the basic code I have for this integration:When running this locally, here is the output I get when calling this with a manual POST request (it doesn't work either when deployed on GCP Functions):
If I manually use
Sentry.captureException(error)
, errors are sent correctly to Sentry, but just instrumenting the code as in the Sentry GCP documentation just doesn't track the errors at all. Also, I don't know if it is normal that I get the same error twice in the console logs.I honestly don't understand what is going on and feel like I will need to manually annotate my code with try/catch and
Sentry.captureException(error)
everywhere in order for the Crash reporting to work... However, this should all be done automatically by@sentry/serverless
.The text was updated successfully, but these errors were encountered: