mirror of
https://github.com/suitenumerique/messages.git
synced 2026-10-01 22:24:57 +02:00
✨(backend) report selfcheck status to Sentry crons
Use the new (documented) env var MESSAGES_SELFCHECK_SENTRY_MONITOR_SLUG to enable
This commit is contained in:
+14
@@ -247,6 +247,20 @@ _Those settings are deprecated and will be removed in the future._
|
||||
| `NEXT_PUBLIC_SENTRY_DSN` | None | Sentry DSN for error tracking | Optional |
|
||||
| `NEXT_PUBLIC_SENTRY_ENVIRONMENT` | None | Sentry environment for error tracking | Optional ('production', 'development', 'staging') |
|
||||
|
||||
### Selfcheck
|
||||
|
||||
End-to-end mail delivery probe — see [selfcheck.md](selfcheck.md) for details.
|
||||
|
||||
| Variable | Default | Description | Required |
|
||||
|----------|---------|-------------|----------|
|
||||
| `MESSAGES_SELFCHECK_FROM` | None | Email address the selfcheck sends from. Leave unset to disable the selfcheck. | Optional |
|
||||
| `MESSAGES_SELFCHECK_TO` | None | Email address the selfcheck sends to. Leave unset to disable the selfcheck. | Optional |
|
||||
| `MESSAGES_SELFCHECK_SECRET` | `self-check-secret-for-dev` | Secret string embedded in the test message body | Optional |
|
||||
| `MESSAGES_SELFCHECK_INTERVAL` | `600` | Interval between selfcheck runs, in seconds | Optional |
|
||||
| `MESSAGES_SELFCHECK_TIMEOUT` | `60` | Timeout for message reception, in seconds | Optional |
|
||||
| `MESSAGES_SELFCHECK_WEBHOOK_URL` | None | Webhook URL POSTed on each successful selfcheck (updown.io-compatible heartbeat) | Optional |
|
||||
| `MESSAGES_SELFCHECK_SENTRY_MONITOR_SLUG` | None | Sentry cron monitor slug. When set (with `SENTRY_DSN`), each run is reported as a Sentry check-in. | Optional |
|
||||
|
||||
### Logging
|
||||
|
||||
| Variable | Default | Description | Required |
|
||||
|
||||
@@ -28,6 +28,10 @@ Optionally, to enable uptime alerting via a selfcheck webhook:
|
||||
|
||||
- `MESSAGES_SELFCHECK_WEBHOOK_URL`: URL of the selfcheck webhook endpoint (default: `None` - disabled)
|
||||
|
||||
Optionally, to report selfcheck runs to [Sentry Crons](https://docs.sentry.io/product/crons/):
|
||||
|
||||
- `MESSAGES_SELFCHECK_SENTRY_MONITOR_SLUG`: Slug of the Sentry cron monitor (default: `None` - disabled). Requires `SENTRY_DSN` to also be set.
|
||||
|
||||
## Usage
|
||||
|
||||
### Manual Execution
|
||||
@@ -95,6 +99,16 @@ The POST body includes timing data:
|
||||
{"send_time": 0.15, "reception_time": 2.34}
|
||||
```
|
||||
|
||||
### Sentry Crons
|
||||
|
||||
When `MESSAGES_SELFCHECK_SENTRY_MONITOR_SLUG` is configured (and `SENTRY_DSN` is set), each selfcheck run is reported to [Sentry Crons](https://docs.sentry.io/product/crons/):
|
||||
|
||||
- An `in_progress` check-in is opened before the test message is sent.
|
||||
- The check-in is closed with status `ok` on success or `error` on failure.
|
||||
- On success, the reported `duration` is `send_time + reception_time`, excluding the post-run cleanup pause.
|
||||
|
||||
Configure the monitor schedule (interval and grace period) in the Sentry UI to match `MESSAGES_SELFCHECK_INTERVAL`. Runs skipped because `MESSAGES_SELFCHECK_FROM` or `MESSAGES_SELFCHECK_TO` is empty do not produce a check-in.
|
||||
|
||||
## Security Considerations
|
||||
|
||||
- The selfcheck uses dedicated test mailboxes that are separate from user data
|
||||
|
||||
Reference in New Issue
Block a user