Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
VikasjKatariyaTPP opened this issue Mar 20, 2025 · 2 comments
Labels
Bug getsentry/sentry-javascript Package: node Issues related to the Sentry Node SDK

Comments

@VikasjKatariyaTPP
Copy link

VikasjKatariyaTPP commented Mar 20, 2025

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'));
@getsantry
Copy link

getsantry bot commented Mar 20, 2025

Assigning to @getsentry/support for routing ⏲️

@getsantry getsantry bot moved this to Waiting for: Support in GitHub Issues with 👀 3 Mar 20, 2025
@dalnoki dalnoki transferred this issue from getsentry/sentry Mar 24, 2025
@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3 Mar 24, 2025
@s1gr1d
Copy link
Member

s1gr1d commented Mar 24, 2025

What is the "staging server"? We would need some more information on the deployment environment. Like is it on aws, Azure, Vercel, ...

And as there is a deployed staging server - is there a production server where the logs are working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug getsentry/sentry-javascript Package: node Issues related to the Sentry Node SDK
Projects
Status: No status
Development

No branches or pull requests

4 participants