feat(meta): Unify detection of serverless environments and add Cloud Run#17168
feat(meta): Unify detection of serverless environments and add Cloud Run#17168
Conversation
Lms24
left a comment
There was a problem hiding this comment.
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).
| /** 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.
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