-
-
Couldn't load subscription status.
- Fork 1.7k
-
Hi, we've been using Sentry to monitor our cloud functions. Up to now the following setup has worked perfectly fine:
const {GCPFunction} = require('@sentry/serverless'); GCPFunction.init({ dsn: process.env.SENTRY_DSN }); const eventHandler = async (data) => { // do something... } exports.publish = process.env.SENTRY_DSN ? GCPFunction.wrapCloudEventFunction(eventHandler) : eventHandler ;
However upgrading to V7 broke this, ironically generating a Sentry issue:
I dove into the upgraded library to see what I need to change, as the migration guide does not mention this part. But I cannot figure it out, and my lack of Typescript/JavaScript knowledge isn't helping here. Also, the documentation is very sparse on this subject, unfortunately.
What I did figure out was that the wrapping is now supposed to be like this:
GCPFunction.wrapCloudEventFunction( (context, callback) => {} )
Only I don't know what to do with this callback, and where/how to pass my event handler to get this to work. Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.