self-hosted
self-hosted copied to clipboard
session replay is not working for javascript browser framework
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
<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
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 I have changed the sample rate to 1.0 but still no session replay has been send to sentry.
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, 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 ??
Can you check your nginx container? We want to make sure that the envelopes are successfully being sent to your sentry instance.
@hubertdeng123, I'm not using niginx instead i'm using traefik and it is working fine.
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
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 🥀