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
2 changes: 1 addition & 1 deletion src/includes/getting-started-install/android.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ android {

// Add Sentry's SDK as a dependency.
dependencies {
implementation 'io.sentry:sentry-android:{{ packages.version('sentry.java', '4.0.0') }}'
implementation 'io.sentry:sentry-android:{{ packages.version('sentry.java', '4.2.0') }}'
Comment thread
marandaneto marked this conversation as resolved.
}
```
6 changes: 3 additions & 3 deletions src/includes/getting-started-install/java.log4j2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-log4j2</artifactId>
<version>{{ packages.version('sentry.java', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-log4j2:{{ packages.version('sentry.java', '4.0.0') }}'
implementation 'io.sentry:sentry-log4j2:{{ packages.version('sentry.java', '4.2.0') }}'
```

```scala {tabTitle: SBT}
libraryDependencies += "io.sentry" % "sentry-log4j2" % "{{ packages.version('sentry.java', '4.0.0') }}"
libraryDependencies += "io.sentry" % "sentry-log4j2" % "{{ packages.version('sentry.java', '4.2.0') }}"
```

For other dependency managers see the [central Maven repository](https://search.maven.org/artifact/io.sentry/sentry-log4j2).
6 changes: 3 additions & 3 deletions src/includes/getting-started-install/java.logback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-logback</artifactId>
<version>{{ packages.version('sentry.java.logback', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java.logback', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-logback:{{ packages.version('sentry.java.logback', '4.0.0') }}'
implementation 'io.sentry:sentry-logback:{{ packages.version('sentry.java.logback', '4.2.0') }}'
```

```scala {tabTitle: SBT}
libraryDependencies += "io.sentry" % "sentry-logback" % "{{ packages.version('sentry.java.logback', '4.0.0') }}"
libraryDependencies += "io.sentry" % "sentry-logback" % "{{ packages.version('sentry.java.logback', '4.2.0') }}"
```

For other dependency managers, see the [central Maven repository](https://search.maven.org/artifact/io.sentry/sentry-logback).
6 changes: 3 additions & 3 deletions src/includes/getting-started-install/java.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ repositories {

// Add Sentry's SDK as a dependency.
dependencies {
implementation 'io.sentry:sentry:{{ packages.version('sentry.java', '4.0.0') }}'
implementation 'io.sentry:sentry:{{ packages.version('sentry.java', '4.2.0') }}'
}
```

```xml {tabTitle:Maven}{filename:pom.xml}
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>{{ packages.version('sentry.java', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java', '4.2.0') }}</version>
</dependency>
```

```scala {tabTitle:SBT}
libraryDependencies += "io.sentry" % "sentry" % "{{ packages.version('sentry.java', '4.0.0') }}"
libraryDependencies += "io.sentry" % "sentry" % "{{ packages.version('sentry.java', '4.2.0') }}"
```
4 changes: 2 additions & 2 deletions src/includes/getting-started-install/java.spring-boot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-spring-boot-starter</artifactId>
<version>{{ packages.version('sentry.java.spring-boot', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java.spring-boot', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-spring-boot-starter:{{ packages.version('sentry.java.spring-boot', '4.0.0') }}'
implementation 'io.sentry:sentry-spring-boot-starter:{{ packages.version('sentry.java.spring-boot', '4.2.0') }}'
```
6 changes: 3 additions & 3 deletions src/includes/getting-started-install/java.spring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-spring</artifactId>
<version>{{ packages.version('sentry.java.spring', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java.spring', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-spring:{{ packages.version('sentry.java.spring', '4.0.0') }}'
implementation 'io.sentry:sentry-spring:{{ packages.version('sentry.java.spring', '4.2.0') }}'
```

```scala {tabTitle: SBT}
libraryDependencies += "io.sentry" % "sentry-spring" % "{{ packages.version('sentry.java.spring', '4.0.0') }}"
libraryDependencies += "io.sentry" % "sentry-spring" % "{{ packages.version('sentry.java.spring', '4.2.0') }}"
```

For other dependency managers see the [central Maven repository](https://search.maven.org/artifact/io.sentry/sentry-spring).
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ For high traffic applications, we recommend using high-throughput HTTP transport
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-apache-http-client-5</artifactId>
<version>{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-apache-http-client-5:{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}'
implementation 'io.sentry:sentry-apache-http-client-5:{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}'
```

```scala {tabTitle:SBT}
libraryDependencies += "io.sentry" % "sentry-apache-http-client-5" % "{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}"
libraryDependencies += "io.sentry" % "sentry-apache-http-client-5" % "{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}"
```
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ For high traffic applications, we recommend using high-throughput HTTP transport
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-apache-http-client-5</artifactId>
<version>{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-apache-http-client-5:{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}'
implementation 'io.sentry:sentry-apache-http-client-5:{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}'
```

```scala {tabTitle:SBT}
libraryDependencies += "io.sentry" % "sentry-apache-http-client-5" % "{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}"
libraryDependencies += "io.sentry" % "sentry-apache-http-client-5" % "{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}"
```

Define the bean, which will be automatically used by Sentry SDK:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import io.sentry.spring.tracing.SentryTransaction;
class ScheduledJob {

@Scheduled(...)
@SentryTransaction
@SentryTransaction(operation = "task")
void execute() {
...
}
Expand All @@ -40,14 +40,16 @@ import io.sentry.spring.tracing.SentryTransaction
class ScheduledJob {

@Scheduled(...)
@SentryTransaction
@SentryTransaction(operation = "task")
fun execute() {
...
}
}
```

`@SentryTransaction` can be configured with custom `name` and `op` properties. If not defined, `name` will be resolved from the class, and the method name.
`@SentryTransaction` can be configured with custom `name`. If not defined, `name` will be resolved from the class, and the method name.
Comment thread
marandaneto marked this conversation as resolved.

`@SentryTransaction` can be also placed on a class or an interface - it turns every method execution from the annotated type into a transaction.

Advanced Spring AOP users can redefine transaction pointcut by providing a custom `org.springframework.aop.Pointcut` bean with name `sentryTransactionPointcut`.

Expand Down Expand Up @@ -76,13 +78,15 @@ import io.sentry.spring.tracing.SentrySpan
@Component
class PersonService {

@SentrySpan
@SentrySpan(operation = "task")
fun findById(id: Long): Person {
...
}
}
```

`@SentrySpan` can be configured with custom `description` and `op` properties. If not defined, `description` will be resolved from the class, and the method name.
`@SentrySpan` can be configured with custom `description` property. If not defined, `operation` will be resolved from the class, and the method name.

`@SentrySpan` can be also placed on a class or an interface - it turns every method execution from the annotated type into a span.

Advanced Spring AOP users can redefine span pointcut by providing a custom `org.springframework.aop.Pointcut` bean with name `sentrySpanPointcut`.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import io.sentry.spring.tracing.SentryTransaction;
class ScheduledJob {

@Scheduled(...)
@SentryTransaction
@SentryTransaction(operation = "task")
void execute() {
...
}
Expand All @@ -67,18 +67,20 @@ import io.sentry.spring.tracing.SentryTransaction
class ScheduledJob {

@Scheduled(...)
@SentryTransaction
@SentryTransaction(operation = "task")
fun execute() {
...
}
}
```

`@SentryTransaction` can be configured with custom `name` and `op` properties. If not defined, `name` will be resolved from the class, and the method name.
`@SentryTransaction` can be configured with custom `name`. If not defined, `name` will be resolved from the class, and the method name.

`@SentryTransaction` can be also placed on a class or an interface - it turns every method execution from the annotated type into a transaction.

Advanced Spring AOP users can redefine transaction pointcut by providing a custom `org.springframework.aop.Pointcut` bean with name `sentryTransactionPointcut`.

### Capturing Span
### Capturing a Span

To create a span around a method execution, annotate method with `@SentrySpan` annotation:

Expand All @@ -103,13 +105,15 @@ import io.sentry.spring.tracing.SentrySpan
@Component
class PersonService {

@SentrySpan
@SentrySpan(operation = "task")
fun findById(id: Long): Person {
...
}
}
```

`@SentrySpan` can be configured with custom `description` and `op` properties. If not defined, `description` will be resolved from the class, and the method name.
`@SentrySpan` can be configured with custom `description` property. If not defined, `operation` will be resolved from the class, and the method name.

`@SentrySpan` can be also placed on a class or an interface - it turns every method execution from the annotated type into a span.

Advanced Spring AOP users can redefine around which methods spans and transactions are created by creating custom advice, pointcut and advisor beans instead of importing `SentryTracingConfiguration` class.
12 changes: 6 additions & 6 deletions src/includes/performance/set-transaction-current-scope/java.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import io.sentry.ITransaction;
import io.sentry.Sentry;

void executeTask() {
ITransaction transaction = Sentry.startTransaction("task");
ITransaction transaction = Sentry.startTransaction("transaction-name", "task");
Sentry.configureScope(scope -> scope.setTransaction(transaction));

executeSubTask();
Expand All @@ -19,9 +19,9 @@ void executeTask() {
private void executeSubTask() {
ISpan span = Sentry.getSpan();
if (span == null) {
span = Sentry.startTransaction("sub-task");
span = Sentry.startTransaction("transaction-name", "sub-task");
} else {
span = span.startChild();
span = span.startChild("operation");
}
// ...
span.finish();
Expand All @@ -34,7 +34,7 @@ import io.sentry.ITransaction
import io.sentry.Sentry

fun executeTask() {
val transaction = Sentry.startTransaction("task")
val transaction = Sentry.startTransaction("transaction-name", "task")
Sentry.configureScope(scope -> scope.setTransaction(transaction))

executeSubTask()
Expand All @@ -45,9 +45,9 @@ fun executeTask() {
private fun executeSubTask() {
var span = Sentry.getSpan()
span = if (span == null) {
Sentry.startTransaction("sub-task")
Sentry.startTransaction("transaction-name", "sub-task")
} else {
span.startChild()
span.startChild("operation")
}
// ...
span.finish()
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/android/integrations/timber.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ The source can be found [on GitHub](https://github.com/getsentry/sentry-java/tre
Using Gradle:

```groovy
implementation 'io.sentry:sentry-android:{{ packages.version('sentry.java.android', '4.0.0') }}'
implementation 'io.sentry:sentry-android-timber:{{ packages.version('sentry.java.android.timber', '4.0.0') }}'
implementation 'io.sentry:sentry-android:{{ packages.version('sentry.java.android', '4.2.0') }}'
implementation 'io.sentry:sentry-android-timber:{{ packages.version('sentry.java.android.timber', '4.2.0') }}'
```

3. Initialize and add the `SentryTimberIntegration`
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/android/usage/advanced-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ compileOptions {

// Add the Sentry Android SDK as a dependency
dependencies {
implementation 'io.sentry:sentry-android-core:{{ packages.version('sentry.java.android', '4.0.0') }}'
implementation 'io.sentry:sentry-android-core:{{ packages.version('sentry.java.android', '4.2.0') }}'
}
```

Expand Down
6 changes: 3 additions & 3 deletions src/platforms/java/common/configuration/transport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ In a separate module, as an optional dependency, the SDK also provides high-thro
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-apache-http-client-5</artifactId>
<version>{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-apache-http-client-5:{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}'
implementation 'io.sentry:sentry-apache-http-client-5:{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}'
```

```scala {tabTitle:SBT}
libraryDependencies += "io.sentry" % "sentry-apache-http-client-5" % "{{ packages.version('sentry.java.apache-http-client-5', '4.0.0') }}"
libraryDependencies += "io.sentry" % "sentry-apache-http-client-5" % "{{ packages.version('sentry.java.apache-http-client-5', '4.2.0') }}"
```

Then configure SDK to use the new transport:
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/java/guides/spring-boot/logging-frameworks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ To use Sentry Logback integration in Spring Boot application you must include a
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-logback</artifactId>
<version>{{ packages.version('sentry.java.logback', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java.logback', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-logback:{{ packages.version('sentry.java.logback', '4.0.0') }}'
implementation 'io.sentry:sentry-logback:{{ packages.version('sentry.java.logback', '4.2.0') }}'
```

Minimum logging levels for `SentryAppender` can be configured in `application.properties` or `application.yml` file.
Expand Down
10 changes: 5 additions & 5 deletions src/platforms/java/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ description: "Learn more about passing configuration options to a static Sentry#
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>{{ packages.version('sentry.java', '4.0.0') }}</version>
<version>{{ packages.version('sentry.java', '4.2.0') }}</version>
</dependency>
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry:{{ packages.version('sentry.java', '4.0.0') }}'
implementation 'io.sentry:sentry:{{ packages.version('sentry.java', '4.2.0') }}'
```

```scala {tabTitle:SBT}
libraryDependencies += "io.sentry" % "sentry" % "{{ packages.version('sentry.java', '4.0.0') }}"
libraryDependencies += "io.sentry" % "sentry" % "{{ packages.version('sentry.java', '4.2.0') }}"
```

For other dependency managers see the [central Maven repository](https://search.maven.org/artifact/io.sentry/sentry-spring).
Expand All @@ -46,7 +46,7 @@ public class MyClass {

// All events get assigned to the release. See more at
// https://docs.sentry.io/workflow/releases/
options.setRelease("io.sentry.samples.console@4.0.0+1");
options.setRelease("io.sentry.samples.console@4.2.0+1");

// Modifications to event before it goes out. Could replace the event altogether
options.setBeforeSend((event, hint) -> {
Expand Down Expand Up @@ -101,7 +101,7 @@ fun main() {

// All events get assigned to the release. See more at
// https://docs.sentry.io/workflow/releases/
options.release = "io.sentry.samples.console@4.0.0+1"
options.release = "io.sentry.samples.console@4.2.0+1"

// Modifications to event before it goes out. Could replace the event altogether
options.beforeSend = BeforeSendCallback { event: SentryEvent, hint: Any? ->
Expand Down