Skip to content

Commit 601ce6c

Browse files
authoredMay 24, 2024··
spring starter 2.4.0 update (#4528)
1 parent 538fba5 commit 601ce6c

File tree

1 file changed

+44
-59
lines changed
  • content/en/docs/zero-code/java/spring-boot

1 file changed

+44
-59
lines changed
 

‎content/en/docs/zero-code/java/spring-boot/_index.md

+44-59
Original file line numberDiff line numberDiff line change
@@ -419,21 +419,32 @@ springBoot {
419419

420420
Automatic instrumentation is available for several frameworks:
421421

422-
| Feature | Property | Default Value |
423-
| -------------- | ----------------------------------------------- | ------------- |
424-
| Logback | `otel.instrumentation.logback-appender.enabled` | true |
425-
| Spring Web | `otel.instrumentation.spring-web.enabled` | true |
426-
| Spring Web MVC | `otel.instrumentation.spring-webmvc.enabled` | true |
427-
| Spring WebFlux | `otel.instrumentation.spring-webflux.enabled` | true |
422+
| Feature | Property | Default Value |
423+
| --------------------- | ----------------------------------------------- | ------------- |
424+
| JDBC | `otel.instrumentation.jdbc.enabled` | true |
425+
| Logback | `otel.instrumentation.logback-appender.enabled` | true |
426+
| Spring Web | `otel.instrumentation.spring-web.enabled` | true |
427+
| Spring Web MVC | `otel.instrumentation.spring-webmvc.enabled` | true |
428+
| Spring WebFlux | `otel.instrumentation.spring-webflux.enabled` | true |
429+
| Kafka | `otel.instrumentation.kafka.enabled` | true |
430+
| MongoDB | `otel.instrumentation.mongo.enabled` | true |
431+
| Micrometer | `otel.instrumentation.micrometer.enabled` | false |
432+
| R2DBC (reactive JDBC) | `otel.instrumentation.r2dbc.enabled` | true |
433+
434+
#### JDBC Instrumentation
435+
436+
| System property | Type | Default | Description |
437+
| ------------------------------------------------------- | ------- | ------- | -------------------------------------- |
438+
| `otel.instrumentation.jdbc.statement-sanitizer.enabled` | Boolean | true | Enables the DB statement sanitization. |
428439

429440
#### Logback
430441

431442
You can enable experimental features with system properties to capture
432443
attributes :
433444

434445
| System property | Type | Default | Description |
435-
| -------------------------------------------------------------------------------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --- |
436-
| `otel.instrumentation.logback-appender.experimental-log-attributes` | Boolean | false | Enable the capture of experimental log attributes `thread.name` and `thread.id`. | |
446+
| -------------------------------------------------------------------------------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
447+
| `otel.instrumentation.logback-appender.experimental-log-attributes` | Boolean | false | Enable the capture of experimental log attributes `thread.name` and `thread.id`. |
437448
| `otel.instrumentation.logback-appender.experimental.capture-code-attributes` | Boolean | false | Enable the capture of [source code attributes]. Note that capturing source code attributes at logging sites might add a performance overhead. |
438449
| `otel.instrumentation.logback-appender.experimental.capture-marker-attribute` | Boolean | false | Enable the capture of Logback markers as attributes. |
439450
| `otel.instrumentation.logback-appender.experimental.capture-key-value-pair-attributes` | Boolean | false | Enable the capture of Logback key value pairs as attributes. |
@@ -549,65 +560,35 @@ public MyService(WebClient.Builder webClientBuilder) {
549560
}
550561
```
551562

552-
### Additional Instrumentations
553-
554-
#### JDBC Instrumentation
563+
#### Kafka Instrumentation
555564

556-
You have two ways to enable the JDBC instrumentation with the OpenTelemetry
557-
starter.
565+
Provides autoconfiguration for the Kafka client instrumentation.
558566

559-
If your application does not declare `DataSource` bean, you can update your
560-
`application.properties` file to have the data source URL starting with
561-
`jdbc:otel:` and set the driver class to
562-
`io.opentelemetry.instrumentation.jdbc.OpenTelemetryDriver`.
567+
| System property | Type | Default | Description |
568+
| --------------------------------------------------------- | ------- | ------- | ---------------------------------------------------- |
569+
| `otel.instrumentation.kafka.experimental-span-attributes` | Boolean | false | Enables the capture of experimental span attributes. |
563570

564-
```properties
565-
spring.datasource.url=jdbc:otel:h2:mem:db
566-
spring.datasource.driver-class-name=io.opentelemetry.instrumentation.jdbc.OpenTelemetryDriver
567-
```
571+
#### Micrometer Instrumentation
568572

569-
You can also wrap the `DataSource` bean in an
570-
`io.opentelemetry.instrumentation.jdbc.datasource.OpenTelemetryDataSource`:
573+
Provides autoconfiguration for the Micrometer to OpenTelemetry bridge.
571574

572-
```java
573-
import io.opentelemetry.instrumentation.jdbc.datasource.JdbcTelemetry;
575+
#### MongoDB Instrumentation
574576

575-
@Configuration
576-
public class DataSourceConfig {
577+
Provides autoconfiguration for the MongoDB client instrumentation.
577578

578-
@Bean
579-
public DataSource dataSource(OpenTelemetry openTelemetry) {
580-
DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
581-
//Data source configurations
582-
DataSource dataSource = dataSourceBuilder.build();
583-
return JdbcTelemetry.create(openTelemetry).wrap(dataSource);
584-
}
579+
| System property | Type | Default | Description |
580+
| -------------------------------------------------------- | ------- | ------- | -------------------------------------- |
581+
| `otel.instrumentation.mongo.statement-sanitizer.enabled` | Boolean | true | Enables the DB statement sanitization. |
585582

586-
}
587-
```
583+
#### R2DBC Instrumentation
588584

589-
With the datasource configuration, you need to add the following dependency:
585+
Provides autoconfiguration for the OpenTelemetry R2DBC instrumentation.
590586

591-
{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}}
587+
| System property | Type | Default | Description |
588+
| -------------------------------------------------------- | ------- | ------- | -------------------------------------- |
589+
| `otel.instrumentation.r2dbc.statement-sanitizer.enabled` | Boolean | true | Enables the DB statement sanitization. |
592590

593-
```xml
594-
<dependencies>
595-
<dependency>
596-
<groupId>io.opentelemetry.instrumentation</groupId>
597-
<artifactId>opentelemetry-jdbc</artifactId>
598-
</dependency>
599-
</dependencies>
600-
```
601-
602-
{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}}
603-
604-
```kotlin
605-
dependencies {
606-
implementation("io.opentelemetry.instrumentation:opentelemetry-jdbc")
607-
}
608-
```
609-
610-
{{% /tab %}} {{< /tabpane>}}
591+
### Additional Instrumentations
611592

612593
#### Log4j2 Instrumentation
613594

@@ -631,6 +612,10 @@ You can find more configuration options for the OpenTelemetry appender in the
631612
[Log4j](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/log4j/log4j-appender-2.17/library/README.md)
632613
instrumentation library.
633614

615+
| System property | Type | Default | Description |
616+
| --------------------------------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------- |
617+
| `otel.instrumentation.log4j-appender.enabled` | Boolean | true | Enables the configuration of the Log4j OpenTelemetry appender with an `OpenTelemetry` instance. |
618+
634619
#### Instrumentation Annotations
635620

636621
This feature uses spring-aop to wrap methods annotated with `@WithSpan` in a
@@ -641,9 +626,9 @@ span by annotating the method parameters with `@SpanAttribute`.
641626
> spring application context. To learn more about aspect weaving in spring, see
642627
> [spring-aop](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#aop).
643628
644-
| Feature | Property | Default Value | ConditionalOnClass |
645-
| ----------- | ------------------------------------------ | ------------- | ------------------ |
646-
| `@WithSpan` | `otel.instrumentation.annotations.enabled` | true | WithSpan, Aspect |
629+
| Feature | Property | Default Value | Description |
630+
| ----------- | ------------------------------------------ | ------------- | --------------------------------- |
631+
| `@WithSpan` | `otel.instrumentation.annotations.enabled` | true | Enables the WithSpan annotations. |
647632

648633
```java
649634
import org.springframework.stereotype.Component;

0 commit comments

Comments
 (0)
Please sign in to comment.