Skip to content

Sentry logs are working on the local server, but they are not working on the staging server (Node js project). #15793

Open
@VikasjKatariyaTPP

Description

@VikasjKatariyaTPP

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

Sentry logs are working on the local server but not on the staging server (Node js project).

Expected Result

No error logs are showing in the staging server's sentry.

Actual Result

Product Area

Unknown

Link

No response

DSN

No response

Version

No response

instruction.js file

const Sentry = require('@sentry/node');
const {nodeProfilingIntegration} = require('@sentry/profiling-node');
const {PrismaInstrumentation} = require('@prisma/instrumentation');

try {
  Sentry.init({
    dsn: process.env.SENTRY_DSN,
    enabled: true,
    debug: true,
    integrations: [
      nodeProfilingIntegration(),
      Sentry.prismaIntegration({
        // Override the default instrumentation that Sentry uses
        prismaInstrumentation: new PrismaInstrumentation(),
      })
    ],
    // Add Tracing by setting tracesSampleRate
    // We recommend adjusting this value in production
    tracesSampleRate: 1.0,
    // Set sampling rate for profiling
    // This is relative to tracesSampleRate
    profilesSampleRate: 1.0,
    // Alternatively, to control sampling dynamically
    // tracesSampler: samplingContext => { /* ... */ }\
    environment: process.env.NODE_ENV
  });
} catch (error) {
  console.error('Sentry initialization failed:', error);
}

Sentry.captureException(new Error('test exception'));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions