Skip to content

Crons monitor upsert support in sentry-cli #1801

@szokeasaurusrex

Description

@szokeasaurusrex

The Sentry CLI already supports monitoring the execution of an arbitrary script or command.

https://docs.sentry.io/product/crons/getting-started/cli/#job-monitoring

sentry-cli monitors run my-monitor-slug -- python path/to/file.py 

To ease usage, we should add support for upserting monitors. This could look something like this.

sentry-cli monitors run my-monitor-slug --schedule 0 * * * * --check_in_margin 5 --max_runtime 10 --time_zone Europe/Vienna  -- python path/to/file.py

Running this command should upsert a monitor on Sentry with the slug my-monitor-slug, a check-in margin of 5 minutes, and a max runtime of 10 minutes, a time zone set to Europe/Vienna, with a schedule that expects it to be run every hour.

https://develop.sentry.dev/sdk/check-ins/#monitor-upsert-support
https://docs.sentry.io/product/crons/getting-started/cli/

monitor_config: None,

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions