|
@@ -402,3 +402,43 @@ export function LaravelUpsertPlatformGuide() {
|
|
|
</Fragment>
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+export function NodeJsUpsertPlatformGuide() {
|
|
|
+ const upsertCode = `const checkInId = Sentry.captureCheckIn(
|
|
|
+ {
|
|
|
+ monitorSlug: '<monitor-slug>',
|
|
|
+ status: 'in_progress',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ schedule: { // Specify your schedule options here
|
|
|
+ type: 'crontab',
|
|
|
+ value: '* * * * *',
|
|
|
+ },
|
|
|
+ checkinMargin: 1,
|
|
|
+ maxRuntime: 1,
|
|
|
+ timezone: 'America/Los_Angeles',
|
|
|
+ });
|
|
|
+
|
|
|
+Sentry.captureCheckIn({
|
|
|
+ checkInId,
|
|
|
+ monitorSlug: '<monitor-slug>',
|
|
|
+ status: 'ok',
|
|
|
+ });
|
|
|
+ `;
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Fragment>
|
|
|
+ <div>
|
|
|
+ {tct(
|
|
|
+ 'Use the [additionalDocs:Node SDK] to create and update your Monitors programmatically with code rather than creating them manually.',
|
|
|
+ {
|
|
|
+ additionalDocs: (
|
|
|
+ <ExternalLink href="https://docs.sentry.io/platforms/node/crons/" />
|
|
|
+ ),
|
|
|
+ }
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ <CodeSnippet language="javascript">{upsertCode}</CodeSnippet>
|
|
|
+ </Fragment>
|
|
|
+ );
|
|
|
+}
|