Skip to content

Commit a16ae97

Browse files
Merge branch 'release/4.0.0-rc.1'
2 parents 9196ab3 + 1c7a306 commit a16ae97

14 files changed

Lines changed: 56 additions & 182 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,23 @@
22

33
<!-- prettier-ignore-start -->
44
> [!IMPORTANT]
5-
> If you are upgrading to the `3.x` versions of the SDK from `2.x` or lower, make sure you follow our
5+
> If you are upgrading to the `4.x` versions of the SDK from `3.x` or lower, make sure you follow our
66
> [migration guide](https://docs.sentry.io/platforms/javascript/guides/capacitor/migration/) first.
77
<!-- prettier-ignore-end -->
88
9-
## Unreleased
9+
## 4.0.0-rc.1
10+
11+
#### Sentry Capacitor V4
12+
13+
Version 4 removes Session Replay and Profiling support. No additional breaking changes
14+
are expected. If these features are enabled through other means, Sentry will not provide support for them.
15+
All other SDK features, including error monitoring and performance monitoring, remain fully supported and
16+
unchanged.
17+
18+
### Break Changes
19+
20+
- Remove Session Replay ([#1214](https://github.com/getsentry/sentry-capacitor/pull/1214))
21+
- Remove Profiling support ([#1217](https://github.com/getsentry/sentry-capacitor/pull/1217))
1022

1123
### Fixes
1224

android/src/main/java/io/sentry/capacitor/SentryCapacitor.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,6 @@ public void initNativeSdk(final PluginCall call) {
154154
}
155155
}
156156

157-
// In case some user enable Android Replay by accident,
158-
// it will not work with JavaScript replay, so we enforce this to disable Android replay.
159-
// If you are interested on being able to use native replay, please open a Github issue
160-
// on the following repo: https://github.com/getsentry/sentry-capacitor.
161-
var controller = options.getSessionReplay();
162-
controller.setSessionSampleRate(null);
163-
controller.setOnErrorSampleRate(null);
164-
165157
options.getLogs().setEnabled(Boolean.TRUE.equals(capOptions.getBoolean("enableLogs", false)));
166158

167159
logger.log(SentryLevel.INFO, String.format("Native Integrations '%s'", options.getIntegrations()));

example/ionic-angular-v7/src/app/app.module.ts

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import { environment } from '../environments/environment';
1414
// ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io
1515
Sentry.init(
1616
{
17-
dsn:
18-
'https://4079af8b316240ea9453eb0a23b715cc@o447951.ingest.sentry.io/5522756',
17+
dsn: 'https://4079af8b316240ea9453eb0a23b715cc@o447951.ingest.sentry.io/5522756',
1918
// An array of strings or regexps that'll be used to ignore specific errors based on their type/message
2019
ignoreErrors: [/MiddleEarth_\d\d/, 'RangeError'],
2120
// To see what the Sentry SDK is doing; Helps when setting things up
@@ -25,22 +24,18 @@ Sentry.init(
2524
// Use the tracing integration to see traces and add performance monitoring
2625
_experiments: {
2726
enableMetrics: true,
28-
beforeSendMetric: (metric) => {
27+
beforeSendMetric: metric => {
2928
return metric;
3029
},
3130
},
3231
integrations: [
3332
Sentry.browserTracingIntegration(),
34-
Sentry.replayIntegration({
35-
maskAllText: false,
36-
blockAllMedia: true,
37-
}),
3833
Sentry.spotlightIntegration({
39-
sidecarUrl: environment.spotlightSidecarUrl,
34+
sidecarUrl: environment.spotlightSidecarUrl,
4035
}),
4136
],
4237
enableLogs: true,
43-
beforeSendLog: (log) => {
38+
beforeSendLog: log => {
4439
return log;
4540
},
4641
// A release identifier
@@ -52,12 +47,6 @@ Sentry.init(
5247
// We recommend adjusting this value in production, or using tracesSampler
5348
// for finer control
5449
tracesSampleRate: 1.0,
55-
// This sets the sample rate to be 10%. You may want this to be 100% while
56-
// in development and sample at a lower rate in production
57-
replaysSessionSampleRate: 0.1,
58-
// If the entire session is not sampled, use the below sample rate to sample
59-
// sessions when an error occurs.
60-
replaysOnErrorSampleRate: 1.0,
6150
},
6251
sentryAngularInit,
6352
);
@@ -75,6 +64,6 @@ Sentry.init(
7564
useValue: createErrorHandler(),
7665
},
7766
],
78-
bootstrap: [AppComponent]
67+
bootstrap: [AppComponent],
7968
})
80-
export class AppModule { }
69+
export class AppModule {}

example/ionic-angular-v8/src/app/app.module.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import { environment } from '../environments/environment';
1414
// ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io
1515
Sentry.init(
1616
{
17-
dsn:
18-
'https://4079af8b316240ea9453eb0a23b715cc@o447951.ingest.sentry.io/5522756',
17+
dsn: 'https://4079af8b316240ea9453eb0a23b715cc@o447951.ingest.sentry.io/5522756',
1918
// An array of strings or regexps that'll be used to ignore specific errors based on their type/message
2019
ignoreErrors: [/MiddleEarth_\d\d/, 'RangeError'],
2120
// To see what the Sentry SDK is doing; Helps when setting things up
@@ -25,22 +24,18 @@ Sentry.init(
2524
// Use the tracing integration to see traces and add performance monitoring
2625
_experiments: {
2726
enableMetrics: true,
28-
beforeSendMetric: (metric) => {
27+
beforeSendMetric: metric => {
2928
return metric;
3029
},
3130
},
3231
integrations: [
3332
Sentry.browserTracingIntegration(),
34-
Sentry.replayIntegration({
35-
maskAllText: false,
36-
blockAllMedia: true,
37-
}),
3833
Sentry.spotlightIntegration({
3934
sidecarUrl: environment.spotlightSidecarUrl,
4035
}),
4136
],
4237
enableLogs: true,
43-
beforeSendLog: (log) => {
38+
beforeSendLog: log => {
4439
return log;
4540
},
4641
// A release identifier
@@ -52,11 +47,6 @@ Sentry.init(
5247
// We recommend adjusting this value in production, or using tracesSampler
5348
// for finer control
5449
tracesSampleRate: 1.0,
55-
// This sets the sample rate to be 10%. You may want this to be 100% while
56-
// in development and sample at a lower rate in production
57-
replaysSessionSampleRate: 1.0, // If the entire session is not sampled, use the below sample rate to sample
58-
// sessions when an error occurs.
59-
replaysOnErrorSampleRate: 1.0,
6050
},
6151
sentryAngularInit,
6252
);
@@ -74,6 +64,6 @@ Sentry.init(
7464
useValue: createErrorHandler(),
7565
},
7666
],
77-
bootstrap: [AppComponent]
67+
bootstrap: [AppComponent],
7868
})
79-
export class AppModule { }
69+
export class AppModule {}

example/ionic-vue3/src/main.ts

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createApp } from 'vue'
2-
import App from './App.vue'
1+
import { createApp } from 'vue';
2+
import App from './App.vue';
33
import router from './router';
44

55
import { IonicVue } from '@ionic/vue';
@@ -26,10 +26,7 @@ import { localConfig } from './config/local';
2626
/* Theme variables */
2727
import './theme/variables.css';
2828

29-
const app = createApp(App)
30-
.use(IonicVue)
31-
.use(router);
32-
29+
const app = createApp(App).use(IonicVue).use(router);
3330

3431
Sentry.init({
3532
dsn: 'https://7f35532db4f8aca7c7b6992d488b39c1@o447951.ingest.sentry.io/4505912397660160',
@@ -38,42 +35,31 @@ Sentry.init({
3835
tracingOptions: {
3936
timeout: 1000,
4037
trackComponents: true,
41-
hooks: ["mount", "update", "unmount"]
42-
}
43-
}),
44-
SentryVue.replayCanvasIntegration({
45-
maskAllText: false,
46-
blockAllMedia: false,
38+
hooks: ['mount', 'update', 'unmount'],
39+
},
4740
}),
48-
...(localConfig.spotlightSidecarUrl ? [Sentry.spotlightIntegration({
49-
sidecarUrl: localConfig.spotlightSidecarUrl,
50-
})] : []),
41+
...(localConfig.spotlightSidecarUrl
42+
? [
43+
Sentry.spotlightIntegration({
44+
sidecarUrl: localConfig.spotlightSidecarUrl,
45+
}),
46+
]
47+
: []),
5148
],
5249
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
53-
// Performance Monitoring
54-
tracesSampleRate: 1.0, // Capture 100% of the transactions
55-
// Session Replay
56-
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.
57-
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
50+
tracesSampleRate: 1.0,
5851
enableLogs: true,
5952
beforeSendLog: (log) => {
6053
return log;
6154
},
55+
});
6256

63-
siblingOptions: {
64-
vueOptions: {
65-
app: app,
66-
attachErrorHandler: false,
67-
attachProps: false,
68-
},
69-
},
70-
},
71-
// Forward the init method from @sentry/vue
72-
SentryVue.init,
73-
);
74-
57+
SentryVue.init({
58+
app: app,
59+
attachErrorHandler: false,
60+
attachProps: false,
61+
});
7562

7663
router.isReady().then(() => {
7764
app.mount('#app');
78-
app.mount('Hello')
7965
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"url": "https://github.com/getsentry/sentry-capacitor"
77
},
8-
"version": "3.2.1",
8+
"version": "4.0.0-rc.1",
99
"description": "Official Sentry SDK for Capacitor",
1010
"types": "dist/esm/index.d.ts",
1111
"main": "dist/build/index.js",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export {
5050
startIdleSpan,
5151
} from '@sentry/core';
5252

53-
export { metrics, replayIntegration, browserTracingIntegration, registerSpanErrorInstrumentation, logger } from '@sentry/browser';
53+
export { metrics, browserTracingIntegration, registerSpanErrorInstrumentation, logger } from '@sentry/browser';
5454

5555
export { pauseAppHangTracking, resumeAppHangTracking } from './wrapper';
5656

src/integrations/logEnricherIntegration.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const logEnricherIntegration = (): Integration => {
1313
cacheLogContext().then(
1414
() => {
1515
client.on('beforeCaptureLog', (log: Log) => {
16-
processLog(log, client);
16+
processLog(log);
1717
});
1818
},
1919
reason => {
@@ -69,7 +69,7 @@ async function cacheLogContext(): Promise<void> {
6969
return Promise.resolve();
7070
}
7171

72-
function processLog(log: Log, client: Client): void {
72+
function processLog(log: Log): void {
7373
if (NativeCache === undefined) {
7474
return;
7575
}
@@ -85,9 +85,6 @@ function processLog(log: Log, client: Client): void {
8585
setLogAttribute(logAttributes, 'os.version', NativeCache.version);
8686
setLogAttribute(logAttributes, 'sentry.release', NativeCache.release);
8787

88-
const replay = client.getIntegrationByName<Integration & { getReplayId: () => string | null }>('Replay');
89-
setLogAttribute(logAttributes, 'sentry.replay_id', replay?.getReplayId());
90-
9188
// Set log.attributes to the variable
9289
log.attributes = logAttributes;
9390
}

src/nativeOptions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ export function FilterNativeOptions(
3535
maxBreadcrumbs: options.maxBreadcrumbs,
3636
// maxValueLength: Only available on the JavaScript Layer.
3737
release: options.release,
38-
// replaysOnErrorSampleRate: Only handled on the JavaScript Layer.
39-
// replaysSessionSampleRate: Only handled on the JavaScript Layer.
4038
sampleRate: options.sampleRate,
4139
sendClientReports: options.sendClientReports,
4240
sendDefaultPii: options.sendDefaultPii,

src/options.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,7 @@ import type { NuxtOptions, VueOptions } from './siblingOptions';
55
// Direct reference of BrowserTransportOptions is not compatible with strict builds of latest versions of Typescript 5.
66
type BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];
77

8-
type CapacitorBrowserClientReplayOptions = {
9-
/**
10-
* The sample rate for session-long replays.
11-
* 1.0 will record all sessions and 0 will record none.
12-
* @deprecated This option will be dropped on Capacitor V4.
13-
*/
14-
replaysSessionSampleRate?: number;
15-
/**
16-
* The sample rate for sessions that has had an error occur.
17-
* This is independent of `sessionSampleRate`.
18-
* 1.0 will record all sessions and 0 will record none.
19-
* @deprecated This option will be dropped on Capacitor V4.
20-
*/
21-
replaysOnErrorSampleRate?: number;
22-
};
23-
24-
export interface BaseCapacitorOptions
25-
extends CapacitorBrowserClientReplayOptions {
8+
export interface BaseCapacitorOptions {
269
/**
2710
* Enables crash reporting for native crashes.
2811
* Defaults to `true`.
@@ -152,6 +135,9 @@ export interface CapacitorOptions
152135
| 'enableMetrics'
153136
| 'replaysOnErrorSampleRate'
154137
| 'replaysSessionSampleRate'
138+
| 'profilesSampleRate'
139+
| 'profileLifecycle'
140+
| 'profileSessionSampleRate'
155141
>,
156142
BaseCapacitorOptions {}
157143

@@ -166,5 +152,8 @@ export interface CapacitorClientOptions
166152
| 'enableMetrics'
167153
| 'replaysOnErrorSampleRate'
168154
| 'replaysSessionSampleRate'
155+
| 'profilesSampleRate'
156+
| 'profileLifecycle'
157+
| 'profileSessionSampleRate'
169158
>,
170159
BaseCapacitorOptions {}

0 commit comments

Comments
 (0)