Skip to content

Commit 92d60e7

Browse files
authored
refactor: migrate java to inline product options syntax (#13450)
1 parent d03aadd commit 92d60e7

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<OnboardingOption optionId="opentelemetry" hideForThisOption>
22
Configuration should happen as early as possible in your application's lifecycle.
33

4-
```java {tabTitle: Java} {"onboardingOptions": {"performance": "9-13"}}
4+
```java {tabTitle: Java}
55
import io.sentry.Sentry;
66

77
Sentry.init(options -> {
@@ -10,15 +10,17 @@ Sentry.init(options -> {
1010
// Add data like request headers and IP for users,
1111
// see https://docs.sentry.io/platforms/java/data-management/data-collected/ for more info
1212
options.setSendDefaultPii(true);
13+
// ___PRODUCT_OPTION_START___ performance
1314

1415
// Set traces_sample_rate to 1.0 to capture 100%
1516
// of transactions for tracing.
1617
// We recommend adjusting this value in production.
1718
options.setTracesSampleRate(1.0);
19+
// ___PRODUCT_OPTION_END___ performance
1820
});
1921
```
2022

21-
```kotlin {tabTitle: Kotlin} {"onboardingOptions": {"performance": "9-13"}}
23+
```kotlin {tabTitle: Kotlin}
2224
import io.sentry.Sentry
2325

2426
Sentry.init { options ->
@@ -27,11 +29,13 @@ Sentry.init { options ->
2729
// Add data like request headers and IP for users,
2830
// see https://docs.sentry.io/platforms/java/data-management/data-collected/ for more info
2931
options.isSendDefaultPii = true
32+
// ___PRODUCT_OPTION_START___ performance
3033

3134
// Set traces_sample_rate to 1.0 to capture 100%
3235
// of transactions for tracing.
3336
// We recommend adjusting this value in production.
3437
options.tracesSampleRate = 1.0
38+
// ___PRODUCT_OPTION_END___ performance
3539
}
3640
```
3741
</OnboardingOption>

platform-includes/getting-started-config/java.spring-boot.mdx

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,35 @@ Sentry's Spring Boot integration auto-configures `sentry.in-app-packages` proper
33
Provide a `sentry.dsn` property using either `application.properties` or `application.yml`:
44

55

6-
```properties {filename:application.properties} {"onboardingOptions": {"performance": "6-10"}}
6+
```properties {filename:application.properties}
77
sentry.dsn=___PUBLIC_DSN___
88

99
# Add data like request headers and IP for users,
1010
# see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info
1111
sentry.send-default-pii=true
12+
# ___PRODUCT_OPTION_START___ performance
1213

1314
# Set traces_sample_rate to 1.0 to capture 100%
1415
# of transactions for tracing.
1516
# We recommend adjusting this value in production.
1617
sentry.traces-sample-rate=1.0
18+
# ___PRODUCT_OPTION_END___ performance
1719
```
1820

19-
```yaml {filename:application.yml} {"onboardingOptions": {"performance": "7-11"}}
21+
```yaml {filename:application.yml}
2022
sentry:
2123
dsn: ___PUBLIC_DSN___
2224

2325
# Add data like request headers and IP for users,
2426
# see https://docs.sentry.io/platforms/java/guides/spring-boot/data-management/data-collected/ for more info
2527
send-default-pii: true
28+
# ___PRODUCT_OPTION_START___ performance
2629

2730
# Set traces_sample_rate to 1.0 to capture 100%
2831
# of transactions for tracing.
2932
# We recommend adjusting this value in production.
3033
tracesSampleRate: 1.0
34+
# ___PRODUCT_OPTION_END___ performance
3135
```
3236

3337
By default, only unhandled exceptions are sent to Sentry. This behavior can be tuned through configuring the `sentry.exception-resolver-order` property. For example, setting it to `-2147483647` (the value of `org.springframework.core.Ordered#HIGHEST_PRECEDENCE`) ensures exceptions that have been handled by exception resolvers with higher order are sent to Sentry - including ones handled by `@ExceptionHandler` annotated methods.

platform-includes/getting-started-config/opentelemetry/java.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
The SDK can be configured using a `sentry.properties` file:
44

5-
```properties {filename:sentry.properties} {"onboardingOptions": {"performance": "5-5"}}
5+
```properties {filename:sentry.properties}
66
dsn=___PUBLIC_DSN___
77
# Add data like request headers and IP for users,
88
# see https://docs.sentry.io/platforms/java/data-management/data-collected/ for more info
99
send-default-pii=true
10+
# ___PRODUCT_OPTION_START___ performance
1011
traces-sample-rate=1.0
12+
# ___PRODUCT_OPTION_END___ performance
1113
```
1214
</OnboardingOption>

0 commit comments

Comments
 (0)