Skip to content

captureCheckIn does not support heartbeat check-ins #9703

Closed
@ToppleTheNun

Description

@ToppleTheNun

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.83.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

  Sentry.init({
    dsn: __MY_DSN__,
    tracesSampleRate: 1.0,
  });

Steps to Reproduce

Read Heartbeat sub-section in Set Up Crons docs: https://docs.sentry.io/platforms/node/crons/#heartbeat

Attempt to setup a call to Sentry.captureCheckIn as demonstrated in the docs:

// src/init.ts
Sentry.captureCheckIn({
  monitorSlug: 'discordbot-heartbeat',
  status: 'ok',
});

Expected Result

TypeScript to be happy and allow me to capture my heartbeat check-in.

Actual Result

$ tsc
src/init.ts:23:29 - error TS2345: Argument of type '{ monitorSlug: string; status: "ok"; }' is not assignable to parameter of type 'CheckIn'.
  Property 'checkInId' is missing in type '{ monitorSlug: string; status: "ok"; }' but required in type 'FinishedCheckIn'.

23       Sentry.captureCheckIn({
                               ~
24         monitorSlug: 'discordbot-heartbeat',
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25         status: 'ok',
   ~~~~~~~~~~~~~~~~~~~~~
26       });
   ~~~~~~~

  node_modules/@sentry/types/types/checkin.d.ts:36:5
    36     checkInId: SerializedCheckIn['check_in_id'];
           ~~~~~~~~~
    'checkInId' is declared here.


Found 1 error in src/init.ts:23

CleanShot 2023-11-29 at 18 04 50@2x

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nodeIssues related to the Sentry Node SDK

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions