Skip to content

feat(node): Add Crons monitoring for BullMQ job schedulers - #25472

Draft
wedamija wants to merge 9 commits into
developfrom
danf/bullmq-cron-monitors
Draft

wedamija wants to merge 9 commits into
developfrom
danf/bullmq-cron-monitors

Conversation

@wedamija

@wedamija wedamija commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Part of a series adding automatic Crons monitoring for the most-used job schedulers in each SDK. Check-ins for a monitor that doesn't exist yet are dropped, so today each monitor has to be created by hand with its schedule copied from the code. Sending the job's schedule as the monitor config lets Sentry create the monitor and keep it in sync.

This adds Sentry.cron.instrumentBullMQWorker, next to the existing cron, node-cron and node-schedule helpers. It wraps the worker's processor function, which BullMQ also uses for sandboxed processors, and listens for completed and failed. With Sentry.BullMQTelemetry the check-ins sit in the job's trace. Each job from a job scheduler sends check-ins under the scheduler id, with its pattern (in tz, or the server's time zone) or every as the monitor config.

const worker = new Worker('reports', processor, { connection });
Sentry.cron.instrumentBullMQWorker(worker, {
  excludeJobSchedulers: ['cache-warmup', /^tmp-/],
});

Schedules Crons can't express, like sub-minute intervals or ?/W syntax, and schedulers with limit or endDate check in without a config. Legacy repeatable jobs (queue.add with repeat) aren't monitored.

pnpm-workspace.yaml adds msgpackr-extract to allowBuilds, which bullmq needs for the integration tests.

Docs: getsentry/sentry-docs#20053

wedamija and others added 2 commits October 19, 2026 17:44
`Sentry.cron.instrumentBullMQWorker(worker)` sends check-ins for every job
the worker runs from a job scheduler, using the scheduler id as the monitor
slug and its `pattern` or `every` as the monitor schedule.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija
wedamija force-pushed the danf/bullmq-cron-monitors branch from dd87bd3 to b7b621e Compare October 20, 2026 00:51
Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija wedamija changed the title feat(node): Add Crons check-ins for BullMQ job schedulers feat(node): Add Crons monitoring for BullMQ job schedulers Oct 20, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
@linear-code

linear-code Bot commented Oct 25, 2026

Copy link
Copy Markdown

JS-4001

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 20dabc3 (PR test merge using develop at b722d3c)

Against: b722d3c (develop) · base run #64034

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.39 kB - -
@sentry/browser - with treeshaking flags 28.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.4 kB - -
@sentry/browser (incl. Tracing) 52.66 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.66 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.59 kB - -
@sentry/browser (incl. Tracing, Replay) 92.89 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.5 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.63 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.6 kB - -
@sentry/browser (incl. Feedback) 47.95 kB - -
@sentry/browser (incl. sendFeedback) 35.47 kB - -
@sentry/browser (incl. FeedbackAsync) 40.57 kB - -
@sentry/browser (incl. Metrics) 31.4 kB - -
@sentry/browser (incl. Logs) 31.68 kB - -
@sentry/browser (incl. Metrics & Logs) 32.36 kB - -
@sentry/react 32.2 kB - -
@sentry/react (incl. Tracing) 54.94 kB - -
@sentry/vue 38.67 kB - -
@sentry/vue (incl. Tracing) 55.55 kB - -
@sentry/svelte 30.42 kB - -
@sentry/remix (Remix 3 client bundle) 57.71 kB - -
CDN Bundle 32.11 kB - -
CDN Bundle (incl. Tracing) 53.14 kB - -
CDN Bundle (incl. Logs, Metrics) 34.31 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.09 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.76 kB - -
CDN Bundle (incl. Tracing, Replay) 91.3 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.26 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.44 kB - -
CDN Bundle - uncompressed 94.47 kB - -
CDN Bundle (incl. Tracing) - uncompressed 157.46 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.02 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.43 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.57 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 279.15 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.1 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 298.79 kB - -
@sentry/nextjs (client) 57.79 kB - -
@sentry/sveltekit (client) 53.11 kB - -
@sentry/core/server 44.34 kB - -
@sentry/core/browser 13.95 kB - -
@sentry/node 155.09 kB +0.01% +15 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.67 kB - -
@sentry/node - without tracing 95.84 kB +0.03% +24 B 🔺
@sentry/node - without channel injection 135.73 kB +0.02% +22 B 🔺
@sentry/aws-serverless 104.01 kB +0.03% +25 B 🔺
@sentry/cloudflare (withSentry) - minified 198.09 kB - -
@sentry/cloudflare (withSentry) 492.11 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 218.68 kB - -

View base workflow run

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 2 not successful, 51 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry (latest) Test (optional) Failing after 3m Details
❌ CI: Optional E2E Tests / E2E node-openai-send-to-sentry (latest) Test (optional) Failing after 3m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, turbopack) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E node-flue-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-3 (canary) Test (optional) Successful in 52s Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 18s Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 24s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 41s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, webpack) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 26s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-standalone (canary, turbopack) Test (optional) Successful in 18s Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4 (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 25s Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E nuxt-4-static (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 14s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 22s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E node-flue-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 16s Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 24s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details

# Conflicts:
#	dev-packages/node-integration-tests/package.json
#	pnpm-lock.yaml
The BullMQ tracing suite from develop also binds 6384.
With BullMQTelemetry, the worker emits `active` before the job's process span
starts, so the in_progress check-in linked to the previous job's trace. Sentry
keeps that trace for the check-in. Send it from the processor instead, and add
an integration test that runs a job scheduler with both enabled.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant