Open jiangbo0216 opened 1 year ago
Hi @jiangbo0216, thanks for writing in and for opening a PR! We're very busy this week but we'll try to look into this next week. Thanks!
hava any update?
Hi @jiangbo0216, thanks for writing in and for opening a PR! We're very busy this week but we'll try to look into this next week. Thanks!
What's happening with this issue? We're looking to use Sentry but this issues prevents us from using it in our serverless functions environment
Hey @simonnztg thanks for writing in. We're currently on company-wide hackweek and thus on limited support. We'll take another look at this next week.
Hi, @simonnztg currently we are not working on this issue because bluntly said, the gcpfunction
integration doesn't get much use (might be a self-fulfilling prophecy). If you want to use Sentry in your GCP functions, as a workaround, you should be able to just use the @sentry/node
package and call Sentry.init()
somewhere in the global scope. This will not automatically track the performance of your functions, but you can manually add Sentry.startSpan()
calls though.
(Corporate speech off: I low-key want to use GCP functions for my side project so this integration may get some love soon.)
Hi, @simonnztg currently we are not working on this issue because bluntly said, the
gcpfunction
integration doesn't get much use (might be a self-fulfilling prophecy). If you want to use Sentry in your GCP functions, as a workaround, you should be able to just use the@sentry/node
package and callSentry.init()
somewhere in the global scope. This will not automatically track the performance of your functions, but you can manually addSentry.startSpan()
calls though.(Corporate speech off: I low-key want to use GCP functions for my side project so this integration may get some love soon.)
Thanks for getting back to me. I thought this might be the case, and I have a workaround in place so we can keep using it for now. FWIW, functions support was one of the main things that attracted me to Sentry.
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/serverless
SDK Version
"@sentry/serverless": "^7.64.0"
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
new a simple google-cloud demo
pnpm i @google-cloud/functions-framework @sentry/serverless
create index.js
start function
const wrapHttpFunction = (execute) => { return (req, res) => { const d = domain.create(); const errorHandler = (err) => { if (res.locals.functionExecutionFinished) { console.error(
Exception from a finished function: ${err}
); } else { res.locals.functionExecutionFinished = true; (0, logger_1.sendCrashResponse)({ err, res }); } }; // Catch unhandled errors originating from this request. d.on('error', errorHandler); d.run(() => { process.nextTick(() => { const ret = execute(req, res); // Catch rejected promises if the function is async. if (ret instanceof Promise) { ret.catch(errorHandler); } }); }); }; };res.send('Hello, World')