Skip to content

Commit fc53893

Browse files
committed
Fixes
1 parent 96b153e commit fc53893

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed

packages/core/src/js/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export class ReactNativeClient extends Client<ReactNativeClientOptions> {
7373
options.enableLogs = false;
7474
}
7575

76+
7677
super(options);
7778

7879
this._outcomesBuffer = [];

samples/expo/app/(tabs)/index.tsx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,6 @@ export default function TabOneScreen() {
3939
}}
4040
/>
4141
</View>
42-
<View style={styles.buttonWrapper}>
43-
<Button
44-
title="Metrics count: Increase"
45-
onPress={() => {
46-
Sentry.metrics.count('sentry_rn_test_metric', 1);
47-
}}
48-
/>
49-
</View>
50-
<View style={styles.buttonWrapper}>
51-
<Button
52-
title="Metrics count: Increase by 100"
53-
onPress={() => {
54-
Sentry.metrics.count('sentry_rn_test_metric', 100);
55-
}}
56-
/>
57-
</View>
5842
<View style={styles.buttonWrapper}>
5943
<Button
6044
title="Capture exception"
@@ -134,6 +118,30 @@ export default function TabOneScreen() {
134118
}}
135119
/>
136120
</View>
121+
<View style={styles.buttonWrapper}>
122+
<Button
123+
title="Send count metric"
124+
onPress={() => {
125+
Sentry.metrics.count('count_metric', 1);
126+
}}
127+
/>
128+
</View>
129+
<View style={styles.buttonWrapper}>
130+
<Button
131+
title="Send distribution metric"
132+
onPress={() => {
133+
Sentry.metrics.count('distribution_metric', 100);
134+
}}
135+
/>
136+
</View>
137+
<View style={styles.buttonWrapper}>
138+
<Button
139+
title="Send count metric with attributes"
140+
onPress={() => {
141+
Sentry.metrics.count('count_metric', 1, { attributes: { from_test_app: true } });
142+
}}
143+
/>
144+
</View>
137145
<View style={styles.buttonWrapper}>
138146
<Button
139147
title="Flush"

samples/expo/app/_layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const navigationIntegration = Sentry.reactNavigationIntegration({
2828

2929
Sentry.init({
3030
// Replace the example DSN below with your own DSN:
31-
dsn: 'https://c96d5b6136315b7a6cef6230a38b4842@o4509786567475200.ingest.de.sentry.io/4510182962298960',
31+
dsn: SENTRY_INTERNAL_DSN,
3232
debug: true,
3333
environment: 'dev',
3434
enableLogs: true,
@@ -44,7 +44,7 @@ Sentry.init({
4444
console.log('Metric beforeSend:', metric.name, metric.value);
4545
return metric;
4646
},
47-
enableMetrics: false,
47+
enableMetrics: true,
4848
// This will be called with a boolean `didCallNativeInit` when the native SDK has been contacted.
4949
onReady: ({ didCallNativeInit }) => {
5050
console.log('onReady called with didCallNativeInit:', didCallNativeInit);

samples/expo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"eas-build-development-android": "eas build --profile development --platform android"
2121
},
2222
"dependencies": {
23-
"@sentry/react-native": "workspace:^",
23+
"@sentry/react-native": "7.6.0",
2424
"@types/react": "~19.0.10",
2525
"expo": "^53.0.0",
2626
"expo-constants": "~17.1.5",

0 commit comments

Comments
 (0)