Title: Crons check-ins are not flushed when run by Vercel Crons · Issue #17136 · getsentry/sentry-javascript · GitHub
Open Graph Title: Crons check-ins are not flushed when run by Vercel Crons · Issue #17136 · getsentry/sentry-javascript
X Title: Crons check-ins are not flushed when run by Vercel Crons · Issue #17136 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/17136
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crons check-ins are not flushed when run by Vercel Crons","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n9.40.0\n\n### Framework Version\n\nNext 15.4.3\n\n### Link to Sentry event\n\nhttps://gabriel-lopes-organization.sentry.io/issues/alerts/rules/crons/flutter/sync-orders/details/\n\n### Reproduction Example/SDK Setup\n\nThe following Vercel Cron route `src/app/api/cron/route.ts` does not flush Crons check-ins, causing them to be marked as \"missed\".\n\n```typescript\nimport { NextRequest, NextResponse } from \"next/server\";\nimport * as Sentry from \"@sentry/nextjs\";\n\nexport const GET = async (req: NextRequest) => {\n const monitorSlug = \"sync-orders\";\n const checkInId = Sentry.captureCheckIn(\n {\n monitorSlug,\n status: \"in_progress\",\n },\n {\n schedule: {\n type: \"crontab\",\n value: \"* * * * *\",\n },\n checkinMargin: 1,\n maxRuntime: 15,\n }\n );\n\n try {\n Sentry.captureCheckIn({\n checkInId,\n monitorSlug: monitorSlug,\n status: \"ok\",\n });\n } catch (e) {\n Sentry.captureException(e);\n Sentry.captureCheckIn({\n checkInId,\n monitorSlug: monitorSlug,\n status: \"error\",\n });\n\n throw e;\n }\n\n return new NextResponse(\"OK\", {\n status: 200,\n });\n};\n\nexport const dynamic = \"force-dynamic\";\nexport const runtime = \"nodejs\";\nexport const maxDuration = 300;\n```\n\nVercel.json:\n```json\n{\n \"crons\": [\n {\n \"path\": \"/api/cron\",\n \"schedule\": \"* * * * *\"\n }\n ]\n}\n```\n\nAdding a `await Sentry.flush()` before returning the response does the trick.\n\n### Steps to Reproduce\n\n1. Create a new Vercel cron route\n2. Instrument Crons\n3. Set up the Vercel cron job\n\n### Expected Result\n\nThe check-ins would be sent to Sentry and the monitor would have it's status as OK.\n\n### Actual Result\n\nCheck-ins are never sent and the monitor is in a failing state with missed check-ins.","author":{"url":"https://github.com/gaprl","@type":"Person","name":"gaprl"},"datePublished":"2025-07-23T23:22:06Z","url":"https://github.com/getsentry/sentry-javascript/issues/17136"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:84e3ee2b-932f-ab25-cf2a-67ccadd43e04 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F64:608F:63F0D4:8511E0:6B05E8CA |
| html-safe-nonce | 004ef6012100c2446dd4584f61718ab13b1a3980b594da9d3804c3308cf75762 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjY0OjYwOEY6NjNGMEQ0Ojg1MTFFMDo2QjA1RThDQSIsInZpc2l0b3JfaWQiOiI3NjYwNDIwNTQxODQ5MTM1MzA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0ad1da983145f2cd44c33949fc69e8f4d022fe1acd88e7943597ee62bec3ec2c |
| hovercard-subject-tag | issue:3257973046 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/17136/issue_layout |
| twitter:image | https://opengraph.githubassets.com/445491242af8d669cb2a05422d466551aae313325fc1534b8a1cb86c77019373/getsentry/sentry-javascript/issues/17136 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/445491242af8d669cb2a05422d466551aae313325fc1534b8a1cb86c77019373/getsentry/sentry-javascript/issues/17136 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gaprl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9e6b0e6e5a9a8e0ddb968297ede4e2eac72d30ea174a0970eb8f22d6958e91e3 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 023691d14ad20c90d3ee61b0a0977b17dc6b6361 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width