Skip to content

Commit 5a15595

Browse files
committed
SE tag added
1 parent e511d08 commit 5a15595

File tree

4 files changed

+45
-8
lines changed

4 files changed

+45
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ buck-out/
5757

5858
# CocoaPods
5959
/ios/Pods/
60+
61+
.env

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ From our [documentation](https://docs.sentry.io/platforms/react-native/), the fo
4444
5. If you don't have cocoapods or get an error about cocopods out of date, run `gem install cocoapods`
4545
6. `npm install`
4646
7. `cd ios && pod install`
47+
8. Optional - Create a .env file in project root and add `SE=<value>`
4748

4849
Don't forget to bump your release version depending on platform
4950
iOS: `Info.plist` `CFBundleShortVersionString`

package-lock.json

Lines changed: 30 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import Toast from 'react-native-toast-message';
2222

2323
import {store} from './reduxApp';
2424
import {DSN} from './config';
25+
import {SE} from '@env'; // SE is undefined if no .env file is set
2526

2627
const reactNavigationV5Instrumentation = new Sentry.ReactNavigationV5Instrumentation(
2728
{
@@ -37,9 +38,14 @@ Sentry.init({
3738
dsn: DSN,
3839
environment: "dev",
3940
beforeSend: (event) => {
40-
// Makes issues unique to the release (app version)
41-
event.fingerprint = ['{{ default }}', packageJson.version ];
42-
return event;
41+
if (SE === "tda") {
42+
// Make issues unique to the release (app version) for Release Health
43+
event.fingerprint = ['{{ default }}', SE, packageJson.version ];
44+
} else if (SE) {
45+
// Make issue for the SE
46+
event.fingerprint = ['{{ default }}', SE ];
47+
}
48+
return event;
4349
},
4450
integrations: [
4551
new Sentry.ReactNativeTracing({
@@ -57,11 +63,13 @@ Sentry.init({
5763
],
5864
tracesSampleRate: 1.0,
5965
enableAutoSessionTracking: true, // For testing, session close when 5 seconds (instead of the default 30) in the background.
60-
sessionTrackingIntervalMillis: 5000,
66+
sessionTrackingIntervalMillis: 5000,
6167
maxBreadcrumbs: 150, // Extend from the default 100 breadcrumbs.
6268
// debug: true
6369
});
6470

71+
Sentry.setTag('se', SE);
72+
6573
const Stack = createStackNavigator();
6674

6775
const App = () => {

0 commit comments

Comments
 (0)