@@ -419,21 +419,32 @@ springBoot {
419
419
420
420
Automatic instrumentation is available for several frameworks:
421
421
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. |
428
439
429
440
#### Logback
430
441
431
442
You can enable experimental features with system properties to capture
432
443
attributes :
433
444
434
445
| 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 ` . |
437
448
| ` 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. |
438
449
| ` otel.instrumentation.logback-appender.experimental.capture-marker-attribute ` | Boolean | false | Enable the capture of Logback markers as attributes. |
439
450
| ` 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) {
549
560
}
550
561
```
551
562
552
- ### Additional Instrumentations
553
-
554
- #### JDBC Instrumentation
563
+ #### Kafka Instrumentation
555
564
556
- You have two ways to enable the JDBC instrumentation with the OpenTelemetry
557
- starter.
565
+ Provides autoconfiguration for the Kafka client instrumentation.
558
566
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. |
563
570
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
568
572
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.
571
574
572
- ``` java
573
- import io.opentelemetry.instrumentation.jdbc.datasource.JdbcTelemetry ;
575
+ #### MongoDB Instrumentation
574
576
575
- @Configuration
576
- public class DataSourceConfig {
577
+ Provides autoconfiguration for the MongoDB client instrumentation.
577
578
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. |
585
582
586
- }
587
- ```
583
+ #### R2DBC Instrumentation
588
584
589
- With the datasource configuration, you need to add the following dependency:
585
+ Provides autoconfiguration for the OpenTelemetry R2DBC instrumentation.
590
586
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. |
592
590
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
611
592
612
593
#### Log4j2 Instrumentation
613
594
@@ -631,6 +612,10 @@ You can find more configuration options for the OpenTelemetry appender in the
631
612
[ Log4j] ( https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/log4j/log4j-appender-2.17/library/README.md )
632
613
instrumentation library.
633
614
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
+
634
619
#### Instrumentation Annotations
635
620
636
621
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`.
641
626
> spring application context. To learn more about aspect weaving in spring, see
642
627
> [ spring-aop] ( https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#aop ) .
643
628
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. |
647
632
648
633
``` java
649
634
import org.springframework.stereotype.Component ;
0 commit comments