Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to set up Google Cloud Functions integration with V7 #5214

Unanswered
pkruithof asked this question in Q&A
Discussion options

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:

image

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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /