Skip to content

feat(spring): Send monitor config from @Scheduled with @SentryCheckIn - #6215

Open
wedamija wants to merge 4 commits into
danf/monitor-config-utilsfrom
danf/spring-checkin-scheduled-config
Open

wedamija wants to merge 4 commits into
danf/monitor-config-utilsfrom
danf/spring-checkin-scheduled-config

Conversation

@wedamija

@wedamija wedamija commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Stacked on #6217 (core MonitorConfigUtils).

📜 Description

For @SentryCheckIn methods, the check-in advice now reads the schedule from the method's @Scheduled annotation and sends it as a monitor config with the check-in, so Sentry creates the monitor, or updates its schedule, from code. This is on by default; @SentryCheckIn(upsertMonitorConfig = false) turns it off.

@Scheduled(cron = "0 0 * * * *")
@SentryCheckIn("hourly-sync")
void sync() { ... }

Cron schedules (with their zone) and fixed-rate intervals are supported. When a schedule can't be represented exactly, such as a fixed delay whose runs drift, the check-in is sent without a config, as today, rather than with a schedule that would cause false missed-check-in alerts. Settings managed in Sentry (margins, max runtime, thresholds) are kept.

The same change is made in sentry-spring, sentry-spring-jakarta and sentry-spring-7; only the packages differ.

💡 Motivation and Context

Check-ins for a monitor that doesn't exist yet are dropped, so today every @SentryCheckIn monitor has to be created by hand in Sentry, with its schedule copied from @Scheduled. The schedule is already in the code, so the SDK can send it, and monitors are created and kept in sync automatically.

This is on by default even though new features are usually opt-in: @SentryCheckIn is already an explicit opt-in to monitoring, and today those check-ins are dropped until the monitor is created by hand. On upgrade, existing monitors get their schedule and timezone from @Scheduled (the JVM zone when zone isn't set); upsertMonitorConfig = false keeps managing them in Sentry.

💚 How did you test it?

SentryCheckInAdviceTest in each Spring module. The schedule conversion is tested in #6217.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Docs: getsentry/sentry-docs#19780

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against d903a79

@sentry

sentry Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.59.0 (1) release

⚙️ sentry-android Build Distribution Settings

Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija
wedamija force-pushed the danf/spring-checkin-scheduled-config branch from ff1e1e2 to 5d745c7 Compare October 5, 2026 22:54
Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija
wedamija marked this pull request as ready for review October 5, 2026 23:28
Co-Authored-By: Claude <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 6f5ad4e. Configure here.

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