-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cron integration for Oban #698
Conversation
lib/sentry/cron/oban.ex
Outdated
def handle_event(event, measurements, metadata, config) | ||
|
||
def handle_event([:oban, :job, :start], _measurements, metadata, _config) do | ||
Sentry.capture_check_in( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not entirely clear from the docs (I've already pinged people to clarify this several times, sorry..)
but if you want these monitors to show up automatically (we call it 'upserting'), you need to add a monitor_config
with a crontab/interval pulled from the job information.
If you don't add a monitor_config
, the user will need to manually add a monitor with a matching slug
in the product view otherwise the corresponding check-ins will be dropped.
This also implies that this integration should probably only deal with periodic jobs and not all general jobs.
In ruby I also expose a mixin module that people can add independently to their jobs, we can do something similar (a plug?) that makes sense in the elixir world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, nice. I'll think about it, but in the meantime I opened sorentwo/oban#1048 for more context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sl0thentr0py this is ready for re-review. Now it's only reporting check ins for periodic jobs, so we should be good to go.
Follow up of #697. The most commonly-used library for job scheduling is definitely Oban, so seems like a reasonable place to start 馃檭.
See also #694.