Skip to content

Commit f2876d3

Browse files
committed
removed code snippet for java and kotlin in android getting started
Renamed profiling to UI profiling and legacy profiling to transaction-based profiling
1 parent 989bf87 commit f2876d3

File tree

3 files changed

+22
-106
lines changed

3 files changed

+22
-106
lines changed

docs/platforms/android/configuration/options.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ Set this boolean to `false` to disable tracing for `OPTIONS` requests. This opti
301301

302302
</ConfigKey>
303303

304-
## Profiling Options
304+
## UI Profiling Options
305305

306306
<Alert title="Note">
307307

308-
Profiling requires SDK versions 8.7.0 or higher. Lower versions can use the <PlatformLink to="/configuration/options/#legacy-profiling-options">legacy profiling</PlatformLink>.
308+
UI Profiling requires SDK versions `8.7.0` or higher. Lower versions can use the <PlatformLink to="/configuration/options/#transaction-based-profiling-options">transaction-based profiling</PlatformLink>.
309309

310310
</Alert>
311311

@@ -317,7 +317,7 @@ A number between `0` and `1`, controlling the percentage chance the session will
317317

318318
<ConfigKey name="profile-lifecycle">
319319

320-
Whether the profiling lifecycle is controlled manually or based on the trace lifecycle. Possible values are:
320+
Whether the UI profiling lifecycle is controlled manually or based on the trace lifecycle. Possible values are:
321321

322322
- `manual`: **default** Profiler must be started and stopped through `Sentry.startProfiler()` and `Sentry.stopProfiler()` APIs
323323
- `trace`: Profiler is started and stopped automatically whenever a sampled trace starts and finishes
@@ -333,9 +333,7 @@ A boolean value that determines whether the app start process will be profiled.
333333

334334
</ConfigKey>
335335

336-
## Legacy Profiling Options
337-
338-
SDK versions lower than 8.7.0 may use the legacy profiling through the following options.
336+
## Transaction Based Profiling Options
339337

340338
<ConfigKey name="profiles-sample-rate">
341339

docs/platforms/android/index.mdx

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -92,81 +92,6 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp
9292
</application>
9393
```
9494

95-
```java {"onboardingOptions": {"performance": "17-18", "profiling": "19-24, 29-33", "session-replay": "25-27"}}
96-
import io.sentry.ProfileLifecycle;
97-
import io.sentry.Sentry;
98-
import io.sentry.android.core.SentryAndroid;
99-
100-
// App main Application class
101-
public class MyApplication extends Application {
102-
103-
@Override
104-
public void onCreate() {
105-
super.onCreate();
106-
SentryAndroid.init(
107-
this,
108-
options -> {
109-
options.setDsn("___PUBLIC_DSN___");
110-
// Add data like request headers, user ip address and device name, see https://docs.sentry.io/platforms/android/data-management/data-collected/ for more info
111-
options.setSendDefaultPii(true);
112-
// Enable the performance API by setting a sample-rate, adjust in production env
113-
options.setTracesSampleRate(1.0);
114-
// Enable profiling, adjust in production env. This is evaluated only once per session
115-
options.setProfileSessionSampleRate(1.0);
116-
// Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes)
117-
options.setProfileLifecycle(ProfileLifecycle.TRACE);
118-
// Enable profiling on app start. The app start profile has to be stopped through Sentry.stopProfiler() if lifecycle is set to `manual`
119-
options.setStartProfilerOnAppStart(true);
120-
// Record session replays for 100% of errors and 10% of sessions
121-
options.getSessionReplay().setOnErrorSampleRate(1.0);
122-
options.getSessionReplay().setSessionSampleRate(0.1);
123-
});
124-
// Start profiling, if lifecycle is set to `manual` and startProfilerOnAppStart is set to `true`
125-
Sentry.startProfiler();
126-
// Stop profiling, if lifecycle is set to `manual` and startProfilerOnAppStart is set to `true`.
127-
// This call is optional. If you don't stop the profiler, it will keep profiling your application until the process exits.
128-
Sentry.stopProfiler();
129-
}
130-
}
131-
```
132-
133-
```kotlin {"onboardingOptions": {"performance": "16-17", "profiling": "18-23, 28-32", "session-replay": "24-26"}}
134-
import io.sentry.ProfileLifecycle;
135-
import io.sentry.Sentry;
136-
import io.sentry.android.core.SentryAndroid;
137-
138-
// App main Application class
139-
class MyApplication : Application() {
140-
141-
override fun onCreate() {
142-
super.onCreate();
143-
SentryAndroid.init(
144-
this,
145-
{ options ->
146-
options.dsn = "___PUBLIC_DSN___"
147-
// Add data like request headers, user ip address and device name, see https://docs.sentry.io/platforms/android/data-management/data-collected/ for more info
148-
options.isSendDefaultPii = true
149-
// Enable the performance API by setting a sample-rate, adjust in production env
150-
options.tracesSampleRate = 1.0
151-
// Enable profiling, adjust in production env. This is evaluated only once per session
152-
options.profileSessionSampleRate = 1.0
153-
// Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes)
154-
options.profileLifecycle = ProfileLifecycle.TRACE
155-
// Enable profiling on app start. The app start profile has to be stopped through Sentry.stopProfiler() if lifecycle is set to `manual`
156-
options.isStartProfilerOnAppStart = true
157-
// Record session replays for 100% of errors and 10% of sessions
158-
options.sessionReplay.onErrorSampleRate = 1.0
159-
options.sessionReplay.sessionSampleRate = 0.1
160-
})
161-
// Start profiling, if lifecycle is set to `manual` and startProfilerOnAppStart is set to `true`
162-
Sentry.startProfiler()
163-
// Stop profiling, if lifecycle is set to `manual` and startProfilerOnAppStart is set to `true`.
164-
// This call is optional. If you don't stop the profiler, it will keep profiling your application until the process exits.
165-
Sentry.stopProfiler()
166-
}
167-
}
168-
```
169-
17095
## Verify
17196

17297
Verify that your app is sending events to Sentry by adding the following snippet, which includes an intentional error. You should see the error reported in Sentry within a few minutes.

docs/platforms/android/profiling/index.mdx

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,20 @@ sidebar_order: 5000
1313

1414
## Installation
1515

16-
Android profiling is available starting in SDK version `8.7.0`.
17-
The legacy profiler is available on SDK versions `6.16.0` and higher through <PlatformLink to="/configuration/options/#legacy-profiling-options">its options</PlatformLink>.
16+
Android UI Profiling is available starting in SDK version `8.7.0`.
17+
The transaction-based profiler is available on SDK versions `6.16.0` and higher through <PlatformLink to="/configuration/options/#transaction-based-profiling-options">its options</PlatformLink>.
1818

19-
## Enabling Profiling
19+
## Enabling UI Profiling
2020

21-
Profiling supports two modes - `manual` and `trace`. The two modes are mutually exclusive, and cannot be used at the same time.
21+
UI Profiling supports two modes - `manual` and `trace`. The two modes are mutually exclusive, and cannot be used at the same time.
2222

2323
In `manual` mode, the profiling data collection can be managed via calls to `Sentry.profiler.startProfiler` and `Sentry.profiler.stopProfiler`. You are entirely in the in control of when the profiler runs.
2424

2525
In `trace` mode, the profiler manages its own start and stop calls, which are based on spans: the profiler continues to run while there is at least one active sampled span, and stops when there are no active sampled spans.
2626

2727
Sentry SDK supports an additional `profileSessionSampleRate` that will enable or disable profiling for the entire <PlatformLink to="/configuration/releases/#sessions">session</PlatformLink>. This sampling decision is evaluated only once per session.
2828

29-
<Alert title="Note">
30-
31-
Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024.
32-
You can still use the legacy profiling for older plans.
33-
34-
</Alert>
35-
36-
### Enabling Trace Lifecycle Profiling
29+
### Enabling Trace Lifecycle UI Profiling
3730

3831
To enable trace profiling, set the lifecycle to `trace`. Trace profiling requires tracing to be enabled.
3932

@@ -46,7 +39,7 @@ By default, some transactions will be created automatically for common operation
4639
<meta-data android:name="io.sentry.dsn" android:value="___PUBLIC_DSN___" />
4740
<!-- Enable tracing, needed for profiling `trace` mode, adjust in production env -->
4841
<meta-data android:name="io.sentry.traces.sample-rate" android:value="1.0" />
49-
<!-- Enable profiling, adjust in production env. This is evaluated only once per session -->
42+
<!-- Enable UI profiling, adjust in production env. This is evaluated only once per session -->
5043
<meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="1.0" />
5144
<meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="trace" />
5245
<!-- Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes -->
@@ -70,7 +63,7 @@ public class MyApplication extends Application {
7063
options.setDsn("___PUBLIC_DSN___");
7164
// Enable tracing, needed for profiling `trace` mode, adjust in production env
7265
options.setTracesSampleRate(1.0);
73-
// Enable profiling, adjust in production env. This is evaluated only once per session
66+
// Enable UI profiling, adjust in production env. This is evaluated only once per session
7467
options.setProfileSessionSampleRate(1.0);
7568
options.setProfileLifecycle(ProfileLifecycle.TRACE);
7669
// Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes
@@ -95,7 +88,7 @@ class MyApplication : Application() {
9588
options.dsn = "___PUBLIC_DSN___"
9689
// Enable tracing, needed for profiling `trace` mode, adjust in production env
9790
options.tracesSampleRate = 1.0
98-
// Enable profiling, adjust in production env. This is evaluated only once per session
91+
// Enable UI profiling, adjust in production env. This is evaluated only once per session
9992
options.profileSessionSampleRate = 1.0
10093
options.profileLifecycle = ProfileLifecycle.TRACE
10194
// Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes
@@ -105,14 +98,14 @@ class MyApplication : Application() {
10598
}
10699
```
107100

108-
### Enabling Manual Lifecycle Profiling
101+
### Enabling Manual Lifecycle UI Profiling
109102

110103
To enable manual profiling, set the lifecycle to `manual`. Manual profiling does not require tracing to be enabled.
111104

112105
```xml {filename:AndroidManifest.xml}
113106
<application>
114107
<meta-data android:name="io.sentry.dsn" android:value="___PUBLIC_DSN___" />
115-
<!-- Enable profiling, adjust in production env. This is evaluated only once per session -->
108+
<!-- Enable UI profiling, adjust in production env. This is evaluated only once per session -->
116109
<meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="1.0" />
117110
<meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="manual" />
118111
<!-- Enable profiling on app start. The app start profile has to be stopped through Sentry.stopProfiler() -->
@@ -135,7 +128,7 @@ public class MyApplication extends Application {
135128
this,
136129
options -> {
137130
options.setDsn("___PUBLIC_DSN___");
138-
// Enable profiling, adjust in production env. This is evaluated only once per session
131+
// Enable UI profiling, adjust in production env. This is evaluated only once per session
139132
options.setProfileSessionSampleRate(1.0);
140133
options.setProfileLifecycle(ProfileLifecycle.MANUAL);
141134
// Enable profiling on app start. The app start profile has to be stopped through Sentry.stopProfiler()
@@ -164,7 +157,7 @@ class MyApplication : Application() {
164157
this,
165158
{ options ->
166159
options.dsn = "___PUBLIC_DSN___"
167-
// Enable profiling, adjust in production env. This is evaluated only once per session
160+
// Enable UI profiling, adjust in production env. This is evaluated only once per session
168161
options.profileSessionSampleRate = 1.0
169162
options.profileLifecycle = ProfileLifecycle.MANUAL
170163
// Enable profiling on app start. The app start profile has to be stopped through Sentry.stopProfiler()
@@ -179,23 +172,23 @@ class MyApplication : Application() {
179172
}
180173
```
181174

182-
### Enabling Legacy Profiling
175+
### Enabling Transaction based Profiling
183176

184177
<Alert>
185178

186-
Android legacy profiling is available starting in SDK version `6.16.0` and is supported on API level 22 and up.
179+
Android transaction-based profiling is available starting in SDK version `6.16.0` and is supported on API level 22 and up.
187180
App start profiling is available starting in SDK version `7.3.0`.
188181

189182
</Alert>
190183

191-
The legacy profiling only runs in tandem with performance transactions that were started either automatically or manually with `Sentry.startTransaction`, and stops automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution.
184+
The transaction-based profiling only runs in tandem with performance transactions that were started either automatically or manually with `Sentry.startTransaction`, and stops automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution.
192185

193186
```xml {filename:AndroidManifest.xml}
194187
<application>
195188
<meta-data android:name="io.sentry.dsn" android:value="___PUBLIC_DSN___" />
196189
<!-- Enable tracing, needed for legacy profiling, adjust in production env -->
197190
<meta-data android:name="io.sentry.traces.sample-rate" android:value="1.0" />
198-
<!-- Enable legacy profiling, adjust in production env. This is relative to traces sample rate -->
191+
<!-- Enable transaction-based profiling, adjust in production env. This is relative to traces sample rate -->
199192
<meta-data android:name="io.sentry.traces.profiling.sample-rate" android:value="1.0" />
200193
<!-- Enable profiling on app start -->
201194
<meta-data android:name="io.sentry.traces.profiling.enable-app-start" android:value="true" />
@@ -219,7 +212,7 @@ public class MyApplication extends Application {
219212
options.setDsn("___PUBLIC_DSN___");
220213
// Enable tracing, needed for legacy profiling, adjust in production env
221214
options.setTracesSampleRate(1.0);
222-
// Enable profiling, adjust in production env. This is relative to traces sample rate
215+
// Enable transaction-based profiling, adjust in production env. This is relative to traces sample rate
223216
options.setProfilesSampleRate(1.0);
224217
// Enable profiling on app start
225218
options.setEnableAppStartProfiling(true);
@@ -243,7 +236,7 @@ class MyApplication : Application() {
243236
options.dsn = "___PUBLIC_DSN___"
244237
// Enable tracing, needed for profiling `trace` mode, adjust in production env
245238
options.tracesSampleRate = 1.0
246-
// Enable profiling, adjust in production env. This is relative to traces sample rate
239+
// Enable transaction-based profiling, adjust in production env. This is relative to traces sample rate
247240
options.profilesSampleRate = 1.0
248241
// Enable profiling on app start
249242
options.isEnableAppStartProfiling = true

0 commit comments

Comments
 (0)