CLI
Important
Sentry Cron Monitoring is currently in open beta and subject to change. Help us make it better by letting us know what you think. Respond on GitHub or write to us at crons-feedback@sentry.io.
Deprecation Notice
Starting with v2.16.1 of the Sentry CLI, the ability to monitor check-ins using an auth
Sentry Crons allows you to monitor the uptime and performance of any scheduled, recurring job. Once implemented, it'll allow you to get alerts and metrics to help you solve errors, detect timeouts, and prevent disruptions to your service.
Requirements
To begin monitoring your recurring, scheduled job:
- Install the Sentry CLI (min v2.16.1).
- Create and configure your first Monitor.
Configuration
The Sentry CLI uses your Monitor's
SENTRY_DSN
environment variable:
export SENTRY_DSN=https://examplePublicKey@o0.ingest.sentry.io/0
Alternatively, you can add it to your ~/.sentryclirc
config:
~/.sentryclirc
[auth]
dsn = https://examplePublicKey@o0.ingest.sentry.io/0
Learn more about the CLI's configuration file.
Job Monitoring
Use the Sentry CLI to run your job and notify you if it doesn't start when expected (missed) or if it exceeded its maximum runtime (failed).
sentry-cli monitors run <monitor_slug> -- <command> <args>
Usage examples:
sentry-cli monitors run my-monitor-slug -- python path/to/file.py
Specifying Monitor Environments (Optional)
If your cron monitor runs in multiple environments you can use the -e
flag to specify which Monitor Environment to send check-ins to.
sentry-cli monitors run -e dev my-monitor-slug -- node path/to/file.js
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").