Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions platform-includes/getting-started-config/java.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<OnboardingOption optionId="opentelemetry" hideForThisOption>
Configuration should happen as early as possible in your application's lifecycle.

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

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

// Set traces_sample_rate to 1.0 to capture 100%
// of transactions for tracing.
// We recommend adjusting this value in production.
options.setTracesSampleRate(1.0);
// ___PRODUCT_OPTION_END___ performance
});
```

```kotlin {tabTitle: Kotlin} {"onboardingOptions": {"performance": "9-13"}}
```kotlin {tabTitle: Kotlin}
import io.sentry.Sentry

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

// Set traces_sample_rate to 1.0 to capture 100%
// of transactions for tracing.
// We recommend adjusting this value in production.
options.tracesSampleRate = 1.0
// ___PRODUCT_OPTION_END___ performance
}
```
</OnboardingOption>
8 changes: 6 additions & 2 deletions platform-includes/getting-started-config/java.spring-boot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,35 @@ Sentry's Spring Boot integration auto-configures `sentry.in-app-packages` proper
Provide a `sentry.dsn` property using either `application.properties` or `application.yml`:


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

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

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
# We recommend adjusting this value in production.
sentry.traces-sample-rate=1.0
# ___PRODUCT_OPTION_END___ performance
```

```yaml {filename:application.yml} {"onboardingOptions": {"performance": "7-11"}}
```yaml {filename:application.yml}
sentry:
dsn: ___PUBLIC_DSN___

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

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
# We recommend adjusting this value in production.
tracesSampleRate: 1.0
# ___PRODUCT_OPTION_END___ performance
```

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

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

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