Closed mburger81 closed 1 week ago
Hi @mburger81 thanks for reaching out. Just to confirm: I'm assuming you are using firebase cloud functions?
@chargome yes we use firebase cloud functions, in v2 here the import part
import * as functions from "firebase-functions/v2";
@mburger81 Currently we do not support auto-instrumentation for firebase cloud functions (there is a note for that on the gcp docs).
You can however make use of manual instrumentation.
Hope that works for you!
@chargome I think I've somewhere read that performance data
is not supported, but Uncaught Exceptions
should be supported, or not?
If not, for what is wrapHttpFunction
? I was supposing this is the wrapper around the firebase functions which handles uncaught exceptions?
So If I got your point, to caught exceptions we should just do something like this:
exports.obtainusergroups = functions.https.onRequest(opts, Sentry.wrapHttpFunction(async (request, response) => {
try {
// Your function logic here
response.status(200).send({
// Your response data here
});
} catch (error) {
Sentry.captureException(error);
response.status(500).send("An internal error occurred");
}
}));
@mburger81 Theoretically wrapHttpFunction
will auto instrument the serverless function for you and also handle uncaught errors. I haven't tested this myself yet, so if this does not work for you, you could still use @sentry/node
and write your custom wrapper for your cloud functions. Feel free to ping me again if you have any questions, I'll open an issue for updating our docs in regards of cloud functions and hopefully provide a working integration for firebase anytime soon.
Hey @chargome thx for your response.
Honestly this wasn't the point, Ive not said its not working. Ive opened here a feature request. Your custom wrapper doesn't support passing HttpOptions, that was my feature request. Nothing more
I think its an important feature
Problem Statement
Looking at your documentation and trying it out, it looks like to me there is no way to pass functions HttpsOptions to the wrapped functions which should pass them to the google cloud functions itself, or maybe Im even Overlooking something
The documentation is saying this:
But we need to handle CORS and Headers, so we have for example something like this,
So opts is passed to functions.https.onRequest, but this with Sentry is not doable which brings limitations
Solution Brainstorm
There should be a way to configure the native functions