getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.97k stars 1.57k forks source link

Can not see replays on sentry dashboard #7043

Closed rameezraja2755 closed 1 year ago

rameezraja2755 commented 1 year ago

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.31.1

Framework Version

18.2.0

Link to Sentry event

https://sentry.io/organizations/shiftms/issues/3912707137/?project=5435573&query=is%3Aunresolved&referrer=issue-stream

SDK Setup

Sentry.init({
  dsn:
    SENTRY_DSN,
  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 0.2,
  // This sets the sample rate to be 10%. You may want this to be 100% while
  // in development and sample at a lower rate in production
  replaysSessionSampleRate: 0.1,

  // If the entire session is not sampled, use the below sample rate to sample
  // sessions when an error occurs.
  replaysOnErrorSampleRate: 1.0,
  integrations: [
    new Sentry.Integrations.Breadcrumbs({
      console: false,
    }),
    new Sentry.Replay(),
  ],
  environment:
    process.env.NEXT_PUBLIC_APP_DOMAIN
    === ('https://shift.ms' || 'https://shift.ms/')
      ? 'production'
      : 'staging',
  // ...
  // Note: if you want to override the automatic release value, do not set a
  // `release` value here - use the environment variable `SENTRY_RELEASE`, so
  // that it will also get attached to your source maps
});

Steps to Reproduce

  1. I am not able to see replay for issues which are logged in sentry from my app

Expected Result

After error occurs in my app i am able to see error in sentry i also want to see its session reply

Actual Result

After error occurs in my app i am able to see error in sentry but not its session replay

Lms24 commented 1 year ago

Hi @rameezraja2755, thanks for writing in! Am I understanding you correctly that you don't get any replays at all?

Would you mind adding the debug: true option to your Sentry.init options. If you check the browser console, you should see some Replay logs. Are there any errors?

The issue you linked appears to be a Node/Server-side issue. Right now we only link errors that happen on the browser to the Replay but we've been talking about linking backend errors to replays in the future.

rameezraja2755 commented 1 year ago

Hi @Lms24

Yes i added debug: true to Sentry.init. there are no error reported in browser console.

Errors from browser doesn't have replay but those are logged in issues without reply. i have added config for replay in sentry.client.config.js.

Thank you

Lms24 commented 1 year ago

Again, can you confirm that you do not get any replays at all? So your list of replays is empty?

Do you see any of these three logs in the browser console (with debug: true):

Sentry Logger [log]: Integration installed: Replay
Sentry Logger [log]: [Replay] Creating new session: <id>
Sentry Logger [log]: [Replay] Using compression worker
rameezraja2755 commented 1 year ago

Yes list of reply is empty in sentry.

no there is no such log in browser console

Lms24 commented 1 year ago

Ok, then we need to take a look why the Replay integration isn't installed. Are you using any special webpack configuration? Which version of NextJS are you on? Would you be able to provide a minimal reproduction so that we can look into this more easily?

I see, you're von SDK version 7.31.1. Would you mind giving v 7.36.0 a try? Maybe we had some problem with Replay+NextJS at this version - might be worth a try.

rameezraja2755 commented 1 year ago

it worked after upgrading to 7.36.0.

but the recording is not good. i think recording is not picking up correct html and css

rameezraja2755 commented 1 year ago

i am not able to see correct styles, layouts buttons texts or any other element. there are only few lines of ****

Lms24 commented 1 year ago

Great to hear that!

i am not able to see correct styles, layouts buttons texts or any other element. there are only few lines of ****

That's intentional as long as you don't set any options to unmask things ;) Read more about privacy-related configuration here: https://docs.sentry.io/platforms/javascript/session-replay/privacy/

Lms24 commented 1 year ago

Ok, let me rephrase: it's intentional to see masked text/input and blocked media.

The missing styles are probably related to a bug on our backend we're investigating and working on right now.

probably related: #7041

rameezraja2755 commented 1 year ago

Thank you for help @Lms24