File tree Expand file tree Collapse file tree 4 files changed +38
-1
lines changed
react-native-macos/src/Screens Expand file tree Collapse file tree 4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 1010
1111### Features
1212
13- - Adds metrics ([ #5402 ] ( https://github.com/getsentry/sentry-react-native/pull/5402 ) )
13+ - Adds Metrics Beta ([ #5402 ] ( https://github.com/getsentry/sentry-react-native/pull/5402 ) )
1414
1515### Dependencies
1616
Original file line number Diff line number Diff line change @@ -86,6 +86,24 @@ const ErrorsScreen = (_props: Props) => {
8686 setScopeProperties ( ) ;
8787 } }
8888 />
89+ < Button
90+ title = "Send count metric"
91+ onPress = { ( ) => {
92+ Sentry . metrics . count ( 'count_metric' , 1 ) ;
93+ } }
94+ />
95+ < Button
96+ title = "Send distribution metric"
97+ onPress = { ( ) => {
98+ Sentry . metrics . count ( 'distribution_metric' , 100 ) ;
99+ } }
100+ />
101+ < Button
102+ title = "Send distribution metric"
103+ onPress = { ( ) => {
104+ Sentry . metrics . count ( 'distribution_metric' , 100 ) ;
105+ } }
106+ />
89107 < Button
90108 title = "Flush"
91109 onPress = { async ( ) => {
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ Sentry.init({
171171 // This should be disabled when manually initializing the native SDK
172172 // Note that options from JS are not passed to the native SDKs when initialized manually
173173 autoInitializeNativeSdk : true ,
174+ enableMetrics : true ,
174175} ) ;
175176
176177function BottomTabsNavigator ( ) {
Original file line number Diff line number Diff line change @@ -114,6 +114,24 @@ const ErrorsScreen = (_props: Props) => {
114114 setScopeProperties ( ) ;
115115 } }
116116 />
117+ < Button
118+ title = "Send count metric"
119+ onPress = { ( ) => {
120+ Sentry . metrics . count ( 'count_metric' , 1 ) ;
121+ } }
122+ />
123+ < Button
124+ title = "Send distribution metric"
125+ onPress = { ( ) => {
126+ Sentry . metrics . count ( 'distribution_metric' , 100 ) ;
127+ } }
128+ />
129+ < Button
130+ title = "Send distribution metric"
131+ onPress = { ( ) => {
132+ Sentry . metrics . count ( 'distribution_metric' , 100 ) ;
133+ } }
134+ />
117135 < Button
118136 title = "Flush"
119137 onPress = { async ( ) => {
You can’t perform that action at this time.
0 commit comments