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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add crons integration extending OpenTelementry and remove Sentry cron wrapper #11790

Open
8 tasks
s1gr1d opened this issue Apr 25, 2024 · 0 comments
Open
8 tasks

Comments

@s1gr1d
Copy link
Member

s1gr1d commented Apr 25, 2024

Problem Statement

The current setup for monitoring crons requires a wrapper function (link to docs). You use it like this:

const CronJobWithCheckIn = Sentry.cron.instrumentCron(CronJob, 'cron_slug');

const job = CronJobWithCheckIn.from({
  cronTime: '7 * * * * *',
  onTick: () => {
    console.log('cron: Job is running every few seconds');
  },
});

job.start();

Solution Brainstorm

We could add a new integration which is extending OpenTelementry and publish it as separate packages and remove the wrapper, which is currently needed. These OTEL instrumentations can also automatically create spans, something that is not supported atm.

If we make these integrations, we need them to be opt-in because crons charge per monitor. We have two options:

  1. Have users explicitly add integrations, with ability to specify monitors they are only interested in
  2. Have all cron integrations enabled by default, but expose a public API options surface to manage what monitors are created.

Phase 1: Initial Implementation

Phase 1: Migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants