Skip to content

Commit 3daa293

Browse files
committed
update default version in install instructions, added code sample for manual profiling in spring-boot
1 parent 063a2d3 commit 3daa293

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

docs/platforms/java/common/profiling/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Continuous profiling is available starting in SDK version `8.23.0` for macOS and
2121
In addition to your typical Sentry dependencies, you will need to add `sentry-async-profiler` as a dependency:
2222

2323
```groovy {tabTitle:Gradle}
24-
implementation 'io.sentry:sentry-async-profiler:{{@inject packages.version('sentry.java.sentry-async-profiler', '8.0.0') }}'
24+
implementation 'io.sentry:sentry-async-profiler:{{@inject packages.version('sentry.java.sentry-async-profiler', '8.23.0') }}'
2525
```
2626
```xml {tabTitle:Maven}
2727
<dependency>
2828
<groupId>io.sentry</groupId>
2929
<artifactId>sentry-async-profiler</artifactId>
30-
<version>{{@inject packages.version('sentry.java.sentry-async-profiler', '8.0.0') }}</version>
30+
<version>{{@inject packages.version('sentry.java.sentry-async-profiler', '8.23.0') }}</version>
3131
</dependency>
3232
```
3333

platform-includes/profiling/automatic-instrumentation-setup/java.spring-boot.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,31 @@ sentry.profile-lifecycle=MANUAL
3131
sentry:
3232
profile-session-sample-rate: 1.0
3333
profile-lifecycle: MANUAL
34+
```
35+
36+
Then use the `startProfiler` and `stopProfiler` methods to start and stop profiling respectively.
37+
38+
39+
```java
40+
import io.sentry.Sentry;
41+
42+
// Start profiling
43+
Sentry.startProfiler();
44+
45+
// run some code here
46+
47+
// Stop profiling
48+
Sentry.stopProfiler();
49+
```
50+
51+
```kotlin
52+
import io.sentry.Sentry
53+
54+
// Start profiling
55+
Sentry.startProfiler()
56+
57+
// run some code here
58+
59+
// Stop profiling
60+
Sentry.stopProfiler()
3461
```

0 commit comments

Comments
 (0)