sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

node-cron and node-schedule fire checkin only on app start

Open s1gr1d opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [X] I have reviewed the documentation https://docs.sentry.io/
  • [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

7.112.1

Framework Version

express 4.19.2

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: env.DSN,
  debug: true,
  tracesSampleRate: 1,
  profilesSampleRate: 1,
  integrations: [new Sentry.Integrations.Express({ app })],
});

Steps to Reproduce

  1. Created an example app with cron, node-cron and node-schedule
  2. look at the log output

Expected Result

When a job from cron is executed, the Sentry logs are correct. But node-cron and node-schedule are only logged on app start. Those should also log like cron.

Actual Result

This is the log. node-schedule and node-cron produce no Sentry logs anymore.

Sentry Logger [info]: Sending checkin: node-cron_slug in_progress
Sentry Logger [info]: Sending checkin: node-cron_slug ok
Sentry Logger [info]: Sending checkin: node-schedule_slug in_progress
Sentry Logger [info]: Sending checkin: node-schedule_slug ok
Example app listening on port 3030                           <-- app starts here, but node-cron and node-schedule are already sending checkins
Sentry Logger [info]: Sending checkin: cron_slug in_progress
cron: Job is running every few seconds                       <-- cron job runs and logs correct info about checkin
Sentry Logger [info]: Sending checkin: cron_slug ok
node-cron: Job is running every few seconds                  <-- node-cron job runs, but no logs
node-schedule: Job is running every few seconds              <-- node-schedule job runs, but no logs

s1gr1d avatar Apr 24 '24 09:04 s1gr1d