Skip to content

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

Closed
@s1gr1d

Description

@s1gr1d

Is there an existing issue for this?

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

Metadata

Metadata

Assignees

Labels

Package: nodeIssues related to the Sentry Node SDK

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions