r/SpringBoot • • Oct 31 '26

How-To/Tutorial I built a starter that discovers every @Scheduled and Quartz job and alerts you when one stops running

Scheduled jobs in Spring fail in the quietest way possible: an exception kills a cron thread, a pool gets starved, a property resolves to the wrong cron, and nothing tells you. You find out days later because a report or a backup is missing.

I've been building SilenceWatch, an open source heartbeat monitor, and its Spring Boot starter is the part I care about most. You add one dependency and an API key:

<dependency>
  <groupId>com.silencewatch</groupId>
  <artifactId>silencewatch-spring-boot-starter</artifactId>
  <version>0.1.0</version>
</dependency>

and in application.yml:

silencewatch:
  api-key: ${SILENCEWATCH_API_KEY}

On startup it finds every @Scheduled method and every Quartz job, declares each one with its resolved schedule (${backup.cron} becomes the actual expression), and reports every run with its duration and any exception. If a job doesn't run when it should, you get an email, Slack, Teams, Discord or webhook alert.

A few things I was strict about:

  • It never fails or blocks your job: errors are swallowed and logged at WARN, and sending happens on a bounded queue in a background daemon thread.
  • No key, no network or no server, and your app behaves exactly as without it. silencewatch.enabled: false turns it all off.
  • No Jackson or other heavy dependency forced on you.
  • Stable job identity (com.acme.jobs.BackupJob#run), so history survives restarts and redeploys. A job removed from the code is flagged orphaned, never deleted.
  • Staging and production show up as separate checks.

Java 17+, tested on Spring Boot 3.5 and 4.1. The server is Apache 2.0 and self-hostable with Docker Compose, free and without limits. There's also a hosted version with a free plan (10 checks).

Starter source: https://github.com/liliang-dev/SilenceWatch/tree/main/clients/java/spring-boot

Site: https://silencewatch.com/spring-boot/

I'd really like feedback from people running a lot of scheduled jobs. What breaks for you that this wouldn't catch?

8 Upvotes

15 comments sorted by

3

u/Historical_Ad4384 Oct 31 '26

Micrometer observations with a grafana should also be able to achieve the same functionality

1

u/LongCelebration4425 Oct 31 '26

True, if you already run Prometheus + Grafana, that gets you close. The difference is you write and maintain one alert per job by hand, “no data” is tricky when the app itself is down, and the alerting lives in the same infra it watches. SilenceWatch reads the schedules straight from your code, treats silence as the alert, and runs outside your stack, for cron scripts too.

1

u/Historical_Ad4384 Oct 31 '26 edited Oct 31 '26

Not sure about everyone but in JVM projects that are used in enterprises I would pefer by hand alerts that I have always control over an API key.

Most JVM users generally consider the alerts by hand as part of their regular task, albeit its done by LLM nowadays.

I do not mean to put you down but explaining to Engineering leadership during incidents that an API key reads it straight from source does not sound good.

Maybe your solution would be good for solo entreprenuers who can't afford the learning curve of Micrometer + Grafana stack.

1

u/LongCelebration4425 Nov 01 '26

Fair point, and I worded that badly. Nothing reads your source: the library runs inside your app, and at startup it sends the job names and their cron expression, that’s all. The key can only write to your SilenceWatch account. It has no access to your app.

If you’d rather keep full control, you can turn auto-registration off, create the checks yourself and just ping them. You can also self-host it (open source). But yeah, if your team already has Micrometer + Grafana down, that’s a perfectly good setup. Small teams without that stack are a big part of who this is for.

2

u/sereikis Oct 31 '26

for replicated deployments, document whether a check means "any instance ran this job" or "every instance ran it," and test one replica going silent while another keeps reporting. shared job identity can hide the first failure, but expecting every replica to run would be wrong for a clustered Quartz job with a single firing owner.

1

u/LongCelebration4425 Oct 31 '26

Good point ! and you're right that it's currently undocumented. Today a check is "any instance ran it": replicas share the job's identity, which is what you want for clustered Quartz or ShedLock-guarded jobs. The gap is per-instance Scheduled work, where one stuck scheduler is masked by the healthy replica. I'll document the semantics and add an opt-in per-instance identity for those jobs. Thanks !

1

u/ducki666 Oct 31 '26

I don't get it.

Why jobs fail silent?

What's that api key?

1

u/LongCelebration4425 Oct 31 '26

A job that crashes usually shows an error. But a job that simply stops running (cron didn’t restart, the worker died…) produces no error at all, so nobody notices. SilenceWatch expects a ping from your job on schedule, and alerts you when it doesn’t arrive (see more here).

The API key is only for our libraries, so they can register your jobs automatically into the SilenceWatch Dashboard. You can create it in your project’s Settings (getting started).

1

u/messi_1988 29d ago

I am trying to create an account on app.silencewatch.com...tried creating a new Gmail account for testing this out for the API key and I keep getting error message An account already exists from this network..sign in to it or contact us if this connection so shared...how to resolve this..what does it mean

1

u/LongCelebration4425 29d ago

Thanks for giving SilenceWatch a try, and sorry about the error. The problem was on our side, not your connection, and it’s now fixed. You can try again now. If anything still gets in the way, just reply to this message and I’ll take care of it. You can give us your feedback at contact@silencewatch.com. Enjoy !

3

u/TurnstileT Oct 31 '26

Thanks, Claude.

1

u/therealkon__ Oct 31 '26

aahhh yes, purple

1

u/nian2326076 Nov 02 '26

For monitoring scheduled jobs effectively, ensure you're checking for misconfigured time zones or unlogged exceptions, as these are common pitfalls. Regular performance audits can help catch issues before they impact your system. If you're also looking for job opportunities in this field, you can use LandOffer to find relevant roles that match your skills.

0

u/[deleted] 28d ago

[removed] — view removed comment

1

u/LongCelebration4425 27d ago

Rolling deploys are fine because new pods declare the same jobs, so it stays one check, and it's up as long as any pod reports.
For jobs that have to run on every instance there's an opt-in per-instance mode (available since 0.2.0 of the java package), you just need a stable instance id. Details here: https://silencewatch.com/docs/spring-boot/#several-instances