GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(nestjs): Derive SentryCron monitor config from @Cron by wedamija · Pull Request #25013 · getsentry/sentry-javascript

Conversation

@wedamija

@wedamija wedamija commented Oct 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

@SentryCron now sends the schedule and time zone of the method's @Cron() decorator with its check-ins, so Sentry creates the monitor on the first run. It's on by default; pass fromCronDecorator: false to send no config. A config with its own schedule is used as is. Monitors created this way are billed, and their schedule and time zone are overwritten from @Cron() on each check-in.

@Cron('0 30 9 * * 1-5', { timeZone: 'Europe/Vienna' })
@SentryCron('daily-report', { checkinMargin: 2 })
async dailyReport() {}

Without a timeZone, the server's local time zone is sent. Schedules Sentry would read differently from @nestjs/schedule (sub-minute, numeric months, some day-field combinations, fixed UTC offsets) check in without a config.

Docs: getsentry/sentry-docs#19782

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry[bot] reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@wedamija wedamija mentioned this pull request Oct 2, 2026
docs(nestjs): Document SentryCron monitor config from @Cron getsentry/sentry-docs#19782
Merged
1 of 6 tasks
@wedamija
wedamija marked this pull request as ready for review October 2, 2026 22:28
@wedamija
wedamija requested a review from a team as a code owner October 2, 2026 22:28
@wedamija
wedamija requested review from chargome and nicohrubec and removed request for a team October 2, 2026 22:28
wedamija and others added 6 commits October 5, 2026 12:55
@wedamija @claude
feat(nestjs): Derive SentryCron monitor config from @Cron
5833c8f
When `@SentryCron` is used without a monitor config, read the schedule and
time zone from the `@Cron()` decorator of `@nestjs/schedule` on the same
method. Check-ins then carry a monitor config, so Sentry creates the monitor
on the first run instead of dropping the check-ins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wedamija @claude
ref(nestjs): Make deriving the SentryCron config from @Cron opt-in
20a2edd
Only read the `@Cron()` schedule when `@SentryCron` gets
`{ fromCronDecorator: true }`, so existing usage keeps sending check-ins
without a monitor config. Other monitor settings passed alongside the flag
are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wedamija @claude
feat(nestjs): Send the @Cron schedule from SentryCron by default
2bd91a3
`@SentryCron` now sends the schedule of the method's `@Cron()` decorator
unless it gets a monitor config with a schedule. Other monitor settings can
still be passed and are merged in, and `fromCronDecorator: false` turns this
off. When `@Cron()` has no `timeZone`, the job runs in the server's local
time zone, so that zone is sent instead of leaving Sentry to assume UTC.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wedamija @claude
feat(nestjs): Send @Cron presets and warn when no config is derived
3c1da94
`@Cron()` presets are now sent: the ones Sentry accepts as is, and
`@midnight`, `@minutely`, `@weekdays` and `@weekends` as crontabs. When no
schedule can be derived but monitor settings were passed, a debug warning
says no monitor config is sent. The settings type now rejects `schedule`
and `timezone`, and a full monitor config rejects `fromCronDecorator`, so
mixed objects no longer drop fields silently.

Adds an E2E case for a disabled `@Cron()` job triggered through an endpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wedamija @claude
fix(nestjs): Only send @Cron schedules Sentry reads the same way
6413911
Skip numeric months (cron 2.x counts from 0), day-of-month/day-of-week
combinations Sentry would AND, and time zones Sentry rejects. Clarify the
warning when fromCronDecorator is false.

Co-Authored-By: Claude <[email protected]>
@wedamija @claude
fix(nestjs): Send @Cron month steps and canonical time zones
8cd5e98
Allow month steps like */3 (CronExpression.EVERY_QUARTER), still skipping
month numbers. Drop the @midnight and @annually presets, which cron rejects.
Skip full day ranges like 1-31 when the other day field is set, and send
the canonical time zone name.

Co-Authored-By: Claude <[email protected]>
@wedamija
wedamija force-pushed the danf/nestjs-cron-config branch from 5d88d04 to 8cd5e98 Compare October 5, 2026 19:57
cursor[bot]
cursor Bot reviewed Oct 5, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8cd5e98. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nestjs/src/decorators.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@wedamija @claude
fix(nestjs): Keep isolateTrace when no monitor config is sent
258a3fc
Co-Authored-By: Claude <[email protected]>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

👋 @chargome, @nicohrubec — Please review this PR when you get a chance!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

2 similar comments
@github-actions

github-actions Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

👋 @chargome, @nicohrubec — Please review this PR when you get a chance!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

👋 @chargome, @nicohrubec — Please review this PR when you get a chance!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wedamija @claude
ref(nestjs): Shorten SentryCron comments
b253af4
Co-Authored-By: Claude <[email protected]>
@wedamija wedamija mentioned this pull request Oct 17, 2026
feat(nestjs): Add an option to monitor every @Cron method #25471
Merged
@github-actions

github-actions Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

👋 @chargome, @nicohrubec — Please review this PR when you get a chance!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

1 similar comment
@github-actions

github-actions Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

👋 @chargome, @nicohrubec — Please review this PR when you get a chance!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@linear-code

linear-code Bot commented Oct 25, 2026

Copy link
Copy Markdown

JS-3999

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wedamija
Merge remote-tracking branch 'origin/develop' into danf/nestjs-cron-c…
47086d7
…onfig
@wedamija
wedamija requested review from a team as code owners October 28, 2026 19:48
@wedamija
wedamija requested review from logaretm and msonnb and removed request for a team October 28, 2026 19:48
@wedamija
wedamija requested review from andreiborza and isaacs October 28, 2026 19:48
@github-actions

github-actions Bot commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: b167dcc (PR test merge using develop at 30cfb4c)

Against: 30cfb4c (develop) · base run #64245

✅ 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.53 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.42 kB - -
@sentry/browser (incl. Tracing) 52.71 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.72 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.69 kB - -
@sentry/browser (incl. Tracing, Replay) 93.01 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.61 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.76 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.75 kB - -
@sentry/browser (incl. Feedback) 47.97 kB - -
@sentry/browser (incl. sendFeedback) 35.49 kB - -
@sentry/browser (incl. FeedbackAsync) 40.6 kB - -
@sentry/browser (incl. Metrics) 31.42 kB - -
@sentry/browser (incl. Logs) 31.72 kB - -
@sentry/browser (incl. Metrics & Logs) 32.44 kB - -
@sentry/react 32.27 kB - -
@sentry/react (incl. Tracing) 55.07 kB - -
@sentry/vue 38.66 kB - -
@sentry/vue (incl. Tracing) 55.73 kB - -
@sentry/svelte 30.42 kB - -
@sentry/remix (Remix 3 client bundle) 57.8 kB - -
CDN Bundle 32.18 kB - -
CDN Bundle (incl. Tracing) 53.23 kB - -
CDN Bundle (incl. Logs, Metrics) 34.45 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.18 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.86 kB - -
CDN Bundle (incl. Tracing, Replay) 91.44 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.56 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.55 kB - -
CDN Bundle - uncompressed 94.62 kB - -
CDN Bundle (incl. Tracing) - uncompressed 157.6 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.09 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.33 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.65 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 279.29 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.99 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 298.7 kB - -
@sentry/nextjs (client) 57.89 kB - -
@sentry/sveltekit (client) 53.22 kB - -
@sentry/core/server 44.24 kB - -
@sentry/core/browser 13.93 kB - -
@sentry/node 154.92 kB +0.02% +16 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.95 kB - -
@sentry/node - without tracing 96.14 kB +0.03% +24 B 🔺
@sentry/node - without channel injection 135.33 kB +0.02% +15 B 🔺
@sentry/aws-serverless 104.32 kB +0.03% +23 B 🔺
@sentry/cloudflare (withSentry) - minified 197.92 kB - -
@sentry/cloudflare (withSentry) 491.93 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 218.35 kB - -

View base workflow run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

isaacs
isaacs reviewed Oct 29, 2026
View reviewed changes

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

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.

A few things below I'd like to confirm and/or fix before landing, but this looks good. Does what it says on the tin :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nestjs/src/decorators.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nestjs/src/decorators.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nestjs/src/decorators.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nestjs/src/decorators.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nestjs/src/decorators.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

wedamija added 2 commits October 28, 2026 17:26
@wedamija
fix(nestjs): Expand @Cron day fields like cron and send numeric month…
0576af0
…s on @nestjs/schedule 4+

A day field that covers every day (like sun-sat or 0,1,2,3,4,5,6) is ignored by cron but ORed by Sentry,
so those schedules are now found by counting the expanded values. Numeric months are sent when the
@Cron() instrumentation saw @nestjs/schedule 4 or later, where cron counts months from 1.
@wedamija
docs(nestjs): Add changelog entry for SentryCron monitor config
a9a89d7
@github-actions

github-actions Bot commented Oct 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 1 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) Successful in 35s Details
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@isaacs
isaacs self-requested a review October 29, 2026 19:37
isaacs
isaacs approved these changes Oct 29, 2026
View reviewed changes

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

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.

All my concerns addressed. Looks good to me!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@isaacs
Merge branch 'develop' into danf/nestjs-cron-config
7e20146
@isaacs
isaacs enabled auto-merge (squash) October 29, 2026 19:40
@isaacs
isaacs merged commit cbab405 into develop Oct 29, 2026
58 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@isaacs
isaacs deleted the danf/nestjs-cron-config branch October 29, 2026 19:48
@wedamija wedamija mentioned this pull request Oct 29, 2026
ref(server-utils): Share one cron converter across cron integrations #25918
Merged
wedamija added a commit that referenced this pull request Nov 2, 2026
@wedamija @claude @nicohrubec
feat(nestjs): Add an option to monitor every @Cron method (#25471)
fd69ba2
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.

Adds `monitorCronJobs` to `nestIntegration`. When it's on, every
`@Cron()` method sends check-ins with the schedule and time zone from
`@Cron()` as the monitor config, so apps don't need `@SentryCron` on
each method. It is off by default. The slug is the `@Cron()` `name`, or
`ClassName.methodName` without one.

```ts
Sentry.init({
  dsn: '...',
  integrations: [Sentry.nestIntegration({ monitorCronJobs: true, excludeCronJobs: ['cleanup', /^Dev/] })],
});
```

Methods that also have `@SentryCron` keep their slug and send one set of
check-ins. Methods with schedules Crons can't express, like every 10
seconds, aren't monitored. It needs `enableRuntimeChannelInjection`,
which is on by default.

Stacked on #25013.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Nicolas Hrubec <[email protected]>
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 5, 2026
publish: getsentry/[email protected] getsentry/publish#10234
Closed
51 tasks done
wedamija added a commit to getsentry/sentry-docs that referenced this pull request Nov 12, 2026
@wedamija @claude
docs(nestjs): Document SentryCron monitor config from @Cron (#19782)
b1c24c7
## DESCRIBE YOUR PR

Documents that `@SentryCron` now sends the schedule and time zone of
`@Cron` on the same method, so check-ins create the monitor. Covers the
server time zone default, which schedules send no config, and the
`fromCronDecorator: false` opt-out.

SDK change: getsentry/sentry-javascript#25013.
Merge after it ships; the page marks it as available since 11.5.0, which
assumes it lands in the next minor.

## IS YOUR CHANGE URGENT?

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

## PRE-MERGE CHECKLIST

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
wedamija added a commit that referenced this pull request Nov 16, 2026
@wedamija @claude
ref(server-utils): Share one cron converter across cron integrations (#…
b0d77ee
…25918)

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.

isaacs asked in review of #25013 for one cron converter, so
`@SentryCron`, `Sentry.cron.*` and the scheduler integrations read
schedules the same way and can't drift apart. They now all use one
converter in `@sentry/server-utils`, which takes the scheduler's dialect
(`node-cron`, `cron` or `cron-parser`), since they read day fields,
names and nicknames differently.

For `Sentry.cron.instrumentCron`, `instrumentNodeCron` and
`instrumentNodeSchedule`, this means: without a time zone, they send the
server's time zone instead of letting Sentry assume UTC. Expressions
Sentry would read differently than the scheduler, like per-second
schedules or `0 9 31 2,4 *`, send no monitor config, so existing
monitors keep their schedule.

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@isaacs isaacs isaacs approved these changes
@chargome chargome Awaiting requested review from chargome chargome was automatically assigned from getsentry/team-javascript-sdks-framework
@nicohrubec nicohrubec Awaiting requested review from nicohrubec nicohrubec was automatically assigned from getsentry/team-javascript-sdks-framework
@logaretm logaretm Awaiting requested review from logaretm logaretm was automatically assigned from getsentry/team-javascript-sdks-browser
@msonnb msonnb Awaiting requested review from msonnb msonnb was automatically assigned from getsentry/team-javascript-sdks-browser
@andreiborza andreiborza Awaiting requested review from andreiborza andreiborza was automatically assigned from getsentry/team-javascript-sdks-server

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@wedamija @isaacs
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.