You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please upvote this issue and leave a comment if you want to see support for this functionality. Thanks!
Reacted by Leonardo E. Dominguez, Natalia Targowska, Ben Unyolo, Mauro Mequelussi, Felipe Torres (fforres), Cameron Bell, Rogério Moreira, Max Holman, Mael Abgrall and Jame
Reacted by Andy Crum, Tory Briggs, Caio Nogueira, Johannes, Leonardo E. Dominguez, Benjamin Oertel, Ben Unyolo, Natalia Targowska, Felipe Torres (fforres) and Max Holman
Reacted by Leonardo E. Dominguez, Natalia Targowska, Ben Unyolo, Felipe Torres (fforres), Max Holman and Jame
you can still use Sentry using the browser version, you just have to call it at the beginning of your cron or workflow.
this is my implementation, a bit wordy but it works perfectly:
import*asSentryBrowserfrom'@sentry/browser';import*asSentryfrom'@sentry/cloudflare';/** * Init reporting clients * @param root named parameters * @param root.sentryDSN the DSN for Sentry (if not in the http worker) */exportfunctioninitReportingClients({
sentryDSN,}: {sentryDSN: string|undefined;}): void{// ...if(sentryDSN){SentryBrowser.init({attachStacktrace: true,dsn: sentryDSN,integrations: [SentryBrowser.captureConsoleIntegration(),SentryBrowser.extraErrorDataIntegration({captureErrorCause: true,depth: 10,}),],// @ts-expect-error This is defined by the bundler// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- This is defined by the bundlerrelease: GITHUB_SHA,sendDefaultPii: true,tracesSampleRate: 1,});}}/** * Capture an exception * @param root named parameters * @param root.error the error to capture * @param root.userID the user ID * @param root.additionalData additional data to send to the error tracking services */exportfunctioncaptureException({
additionalData,
error,
userID,}: {additionalData?: {[key: string]: unknown};error: unknown;userID: string|undefined;}): void{if(Sentry.isEnabled()){Sentry.captureException(error,{extra: additionalData,user: userID
? {id: userID,}
: undefined,});}elseif(SentryBrowser.isEnabled()){SentryBrowser.captureException(error,{extra: additionalData,user: userID
? {id: userID,}
: undefined,});}else{logger.error('No error tracking service enabled!');}}
Activity
andycrum commentedon Jun 2, 2025
Would love to see support for this! Workflows are an important part of our infrastructure and surfacing exceptions from them is really important.
torybriggs commentedon Jun 2, 2025
Yes! Would love to see Workflows supported.
AbhiPrasad commentedon Jun 5, 2025
Alright thanks for the comments and reacts everyone! We're going to start working on this :)
amiranvarov commentedon Jun 6, 2025
We need this FEATURE! Please set a high priority for this one!
Mael-Abgrall commentedon Jun 6, 2025
just my two cents for anyone who needs it NOW
you can still use Sentry using the browser version, you just have to call it at the beginning of your cron or workflow.
this is my implementation, a bit wordy but it works perfectly:
feat(cloudflare): Add `instrumentWorkflowWithSentry` to instrument wo…
AbhiPrasad commentedon Jun 23, 2025
This will go out with the next release!
amiranvarov commentedon Jun 23, 2025
Great! Any ETA on when the next release is expected?
AbhiPrasad commentedon Jun 23, 2025
Wednesday afternoon at the latest
github-actions commentedon Jun 25, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #16672, which was included in the 9.32.0 release.
AbhiPrasad commentedon Jun 26, 2025
Docs are now live! https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/workflows/
AbhiPrasad commentedon Jun 26, 2025
and here's what it looks like: