Skip to content

Commit 94786fd

Browse files
authored
Merge pull request #15054 from guardian/revert-14782-SiAdcock-patch-1
Reinstate Sentry sample rate of 1%
2 parents e624608 + f23ff65 commit 94786fd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dotcom-rendering/src/client/sentryLoader/sentryLoader.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Enable Sentry when it passes loading conditions', () => {
3434
}),
3535
).toEqual(true);
3636
});
37-
it('does enable Sentry for 0.1% of users', () => {
37+
it('does enable Sentry for 1% of users', () => {
3838
expect(
3939
isSentryEnabled({
4040
isDev: false,
@@ -56,7 +56,7 @@ describe('Enable Sentry when it passes loading conditions', () => {
5656
isDev: false,
5757
enableSentryReporting: true,
5858
isInBrowserVariantTest: false,
59-
random: 99.9001 / 100,
59+
random: 99.0001 / 100,
6060
}),
6161
).toEqual(true);
6262
expect(

dotcom-rendering/src/client/sentryLoader/sentryLoader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const isSentryEnabled = ({
2424
if (isInBrowserVariantTest) return true;
2525
// Sentry lets you configure sampleRate to reduce the volume of events sent
2626
// but this filter only happens _after_ the library is loaded. The Guardian
27-
// measures page views in the billions so we only want to log 0.1% of errors that
27+
// measures page views in the billions so we only want to log 1% of errors that
2828
// happen but if we used sampleRate to do this we'd be needlessly downloading
29-
// Sentry 99.9% of the time. So instead we just do some math here and use that
29+
// Sentry 99% of the time. So instead we just do some math here and use that
3030
// to prevent the Sentry script from ever loading.
31-
if (random <= 999 / 1000) return false;
31+
if (random <= 99 / 100) return false;
3232
return true;
3333
};
3434

0 commit comments

Comments
 (0)