self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

session replay is not working for javascript browser framework

Open singhdimple opened this issue 1 year ago • 4 comments

Problem Statement

No session replay is sent to sentry I'm using below html file to integrate sentry but no session replay can be seen in my project

TestProject
    <script src="https://sentry-onprem.dev.services.mdgapp.net/js-sdk-loader/*.min.js" crossorigin="anonymous"></script>

    <script>
      Sentry.onLoad(function() {
        Sentry.init({
          integrations: [
            Sentry.replayIntegration({
              maskAllText: false,
              blockAllMedia: false,
            }),
          ],
          // Session Replay
          replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
          replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
        });
      });
    </script>
    

</head>
<body>
    <h1>TestProject</h1>
    <h2>hello world</h2>
    <script>
      myUndefinedFunction();
    </script>
</body>

Solution Brainstorm

No response

singhdimple avatar Aug 23 '24 15:08 singhdimple

Your sample rate is 0.1, are there errors being sent to your Sentry project? Otherwise, it is likely that no session replays will be sent.

hubertdeng123 avatar Aug 26 '24 23:08 hubertdeng123

@hubertdeng123 I have changed the sample rate to 1.0 but still no session replay has been send to sentry.

singhdimple avatar Aug 27 '24 13:08 singhdimple

By any chance, have you add this into your sentry/sentry.conf.py file?

https://github.com/getsentry/self-hosted/blob/3cf323843ab9e63515bd2816a426bd5116324834/sentry/sentry.conf.example.py#L377-L381

aldy505 avatar Aug 29 '24 03:08 aldy505

@aldy505, Yes I'm using this(JS_SDK_LOADER_DEFAULT_SDK_URL = "https://browser.sentry-cdn.com/%s/bundle.tracing.min.js") in my sentry.conf.py because without it I'm getting CORS error. is it affecting my session reply ??

singhdimple avatar Aug 29 '24 07:08 singhdimple

Can you check your nginx container? We want to make sure that the envelopes are successfully being sent to your sentry instance.

hubertdeng123 avatar Sep 03 '24 23:09 hubertdeng123

@hubertdeng123, I'm not using niginx instead i'm using traefik and it is working fine.

singhdimple avatar Sep 05 '24 09:09 singhdimple

Ah fellow Traefik user.

You have to configure a CORS header on your Traefik route rule. See https://develop.sentry.dev/self-hosted/reverse-proxy/#traefik

aldy505 avatar Sep 05 '24 10:09 aldy505

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Sep 27 '24 07:09 getsantry[bot]