Skip to content
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

Merged
merged 10 commits into from
Mar 2, 2024
Merged

Add cron integration for Oban #698

merged 10 commits into from
Mar 2, 2024

Conversation

whatyouhide
Copy link
Collaborator

@whatyouhide whatyouhide commented Feb 26, 2024

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.

def handle_event(event, measurements, metadata, config)

def handle_event([:oban, :job, :start], _measurements, metadata, _config) do
Sentry.capture_check_in(
Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

@whatyouhide whatyouhide merged commit 30a684a into master Mar 2, 2024
3 checks passed
@whatyouhide whatyouhide deleted the al/cron-oban branch March 2, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants