Skip to content

Commit 74a31a3

Browse files
committed
add isolateTrace option to node-cron instrument
1 parent e5780bb commit 74a31a3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/node-core/src/cron/node-cron.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { captureException, withMonitor } from '@sentry/core';
1+
import { captureException, type MonitorConfig, withMonitor } from '@sentry/core';
22
import { replaceCronNames } from './common';
33

44
export interface NodeCronOptions {
@@ -28,7 +28,10 @@ export interface NodeCron {
2828
* );
2929
* ```
3030
*/
31-
export function instrumentNodeCron<T>(lib: Partial<NodeCron> & T): T {
31+
export function instrumentNodeCron<T>(
32+
lib: Partial<NodeCron> & T,
33+
monitorConfig: Pick<MonitorConfig, 'isolateTrace'> = {},
34+
): T {
3235
return new Proxy(lib, {
3336
get(target, prop) {
3437
if (prop === 'schedule' && target.schedule) {
@@ -65,6 +68,7 @@ export function instrumentNodeCron<T>(lib: Partial<NodeCron> & T): T {
6568
{
6669
schedule: { type: 'crontab', value: replaceCronNames(expression) },
6770
timezone,
71+
...monitorConfig,
6872
},
6973
);
7074
};

0 commit comments

Comments
 (0)