You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import * as Sentry from '@sentry/nestjs';
import { nodeProfilingIntegration } from '@sentry/profiling-node';
Sentry.init({
dsn: __YOUR_DSN__,
integrations: [nodeProfilingIntegration()],
// Tracing
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set sampling rate for profiling - this is relative to tracesSampleRate
profilesSampleRate: 1.0,
environment: process.env.NODE_ENV ?? 'development',
});
import^ at the top of the main.ts file
create a module that has this service:
import { Cron, CronExpression } from '@nestjs/schedule';
import { Injectable } from '@nestjs/common';
import { SentryTraced } from '@sentry/nestjs';
@Injectable()
export class CronJobs {
@Cron(CronExpression.EVERY_MINUTE, {
name: 'testinCron',
timeZone: 'America/New_York',
})
@SentryTraced()
async testCron() {
throw new Error('Test error');
}
}
Steps to Reproduce
create a Nest.js project, add the above code, and start the server
Expected Result
the error should appear in Sentry
Actual Result
no error is reported
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nestjs
SDK Version
8.34.0
Framework Version
10.0.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
import^ at the top of the main.ts file
create a module that has this service:
Steps to Reproduce
Expected Result
the error should appear in Sentry
Actual Result
no error is reported
The text was updated successfully, but these errors were encountered: