-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(meta): Unify detection of serverless environments and add Cloud Run #17168
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is technically correct, and aligning here is fine. On that note, wdyt about maintaining this list in core instead?
However, I'm pretty sure that it's not enough for cloudflare for example, where we need Cloudflare's waitUntil
helper to call
waitUntil(flush(2000))
The good news is that we get this by using the Cloudflare SDK request handler in SDKs where we support a framework on CF (like Nuxt and Sveltekit).
@@ -5,7 +5,13 @@ import { DEBUG_BUILD } from '../common/debug-build'; | |||
|
|||
/** Flush the event queue to ensure that events get sent to Sentry before the response is finished and the lambda ends */ | |||
export async function flushIfServerless(): Promise<void> { | |||
const isServerless = !!process.env.LAMBDA_TASK_ROOT || !!process.env.VERCEL; | |||
const isServerless = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: for a follow up, can we upstream this into core possibly, and re-use this in meta SDKs?
I'll create a utility for this in the core package in another PR :) However, it's not possible to include Cloudflare's |
…Run (#17168) Adds Google Cloud Run environment variable to serverless detection to wait until flushing. Documented here: https://cloud.google.com/run/docs/configuring/services/environment-variables#reserved related to this: #17165
…ud Run (#17204) Backport of this PR: #17168 Adds Google Cloud Run environment variable to serverless detection to wait until flushing. Documented here: https://cloud.google.com/run/docs/configuring/services/environment-variables#reserved related to this: #17165
Follow-up for this PR: #17168 Creating a shared function `flushIfServerless` as this functionality is used quite often in various SDKs.
Follow-up for this PR: #17168 Creating a shared function `flushIfServerless` as this functionality is used quite often in various SDKs.
Adds Google Cloud Run environment variable to serverless detection to wait until flushing.
Documented here: https://cloud.google.com/run/docs/configuring/services/environment-variables#reserved
related to this: #17165