Monitoring and Oh Dear | laravel-schedule-monitor-go | Spatie       

 SPATIE  

laravel-schedule-monitor-go
===========================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-schedule-monitor-go](https://spatie.be/docs/laravel-schedule-monitor-go/v1)  Monitoring and Oh Dear

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-schedule-monitor-go/v1) 

  Monitoring and Oh Dear    
- [ Introduction ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/introduction)
- [ Installation and setup ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/usage)
- [ Monitoring and Oh Dear ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/monitoring)
- [ Customization ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/customization)
- [ Testing ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/releasing)
- [ Changelog ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/changelog)
- [ Support us ](https://spatie.be/docs/laravel-schedule-monitor-go/v1/support-us)

 Monitoring and Oh Dear
======================

###  On this page 

1. [ Completion deadlines ](#content-completion-deadlines)
2. [ Queued delivery ](#content-queued-delivery)
3. [ Unsupported methods and differences from PHP ](#content-unsupported-methods-and-differences-from-php)
4. [ Third party scheduled task monitors ](#content-third-party-scheduled-task-monitors)

Completion deadlines
--------------------------------------------------------------------------------------------------------------------

Monitoring begins in the UTC minute of first sync. Sync preserves that baseline. A task becomes late strictly after its first expected run plus grace. Missing another period does not reset the deadline, and a skipped run does not satisfy it. Successful completion advances the expected run to the next native cron occurrence.

Failure remains visible until a later success, even if another run starts or is skipped. The last persisted terminal event breaks timestamp ties. A task that starts without completing is running until its deadline passes. Native `TaskFinished` with an error is ignored because the following `TaskFailed` supplies the terminal log. Failures in checks or locks can occur without a starting event.

The port uses Laravel's own cron evaluator for deadlines, including last-day-of-month schedules and Sunday aliases. It does not maintain a second cron parser.

Queued delivery
-----------------------------------------------------------------------------------------------------

Logs and timestamps are committed together before dispatch. A pending marker remains if dispatch or HTTP delivery fails. Recover an individual pending entry with `Monitor.Ping(ctx, logID)` or redispatch its native job. There is no automatic outbox sweep. Do not deliver the same entry concurrently from a manual consumer and a worker.

Delivery is at least once. A crash after HTTP success but before acknowledgement can resend a ping. Three HTTP attempts with ten-second delays are the default. HTTP timeouts are ten seconds per attempt. Logs older than ten minutes expire without HTTP and without updating `LastPingedAt`. Pruning retains pending entries, so process old pending entries as expired after an outage.

Remote provisioning uses the API token. Ping requests never include it. Both reject redirects, and remote writes have no automatic retries. Custom API and ping endpoint URLs must use HTTP or HTTPS without credentials, fragments or query strings. Only configure trusted endpoints. A custom ping endpoint appends the returned check UUID.

`OhDearPingFailed` exposes the log, status and elapsed duration after a failed HTTP pass. Its error and debug logs omit secret endpoint URLs and response bodies. The framework's own HTTP tracing may still capture application data, so protect that separately. The `Task.PingURL` field is omitted when serializing task status to JSON.

Unsupported methods and differences from PHP
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

- Laravel Go v0.1.0 evaluates schedules in UTC. This port does not add non-UTC schedules or DST conversion.
- Sub-minute schedules are rejected at sync unless ignored.
- `Between`, `UnlessBetween`, `When` and `Skip` produce native skip events, but the monitor cannot derive cron deadlines from their runtime predicates. They can cause late status and Oh Dear alerts. Use an accurate cron schedule instead.
- Scheduled jobs measure dispatch to the queue, not eventual worker completion.
- There is no detached background completion listener. Laravel Go waits for concurrent commands, or runs them in sequence with `Blocking`.
- The native public task information does not expose task kind. Functions and jobs are grouped as `callback`, other tasks as `command`. Names and command arguments remain native.
- Memory reports current process heap allocation, which includes concurrent tasks, rather than isolated PHP process memory. Runtime reports seconds.
- Cron descriptions remain the actual expression rather than an English translation.
- PHP model pruning becomes `schedule-monitor:prune`. Horizon job silencing and PHP multitenancy configuration do not apply.
- This is a new database schema, not a shared-store adapter or migration from the PHP or Rust schema.

Third party scheduled task monitors
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

When scheduled tasks do not run properly, a task that sends notifications would probably not run either. That is why this package does not send notifications by itself.

These services can notify you when scheduled tasks do not run properly:

- [Oh Dear](https://ohdear.app)
- [Healthchecks.io](https://healthchecks.io)
- [Cronitor](https://cronitor.io)
- [Cronhub](https://cronhub.io)
- [Dead Man's Snitch](https://deadmanssnitch.com)

Oh Dear has built-in integration. Other services need an application-owned job or integration.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
