Skip to content

Commit bd63eb3

Browse files
authored
Merge pull request quarkusio#47976 from brunobat/consolidate-jdbc-metrics-props
Update datasource observability configs docs and setup
2 parents fdcdefe + a9ddc59 commit bd63eb3

File tree

5 files changed

+11
-26
lines changed

5 files changed

+11
-26
lines changed

docs/src/main/asciidoc/opentelemetry-tracing.adoc

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -194,24 +194,9 @@ Hit `CTRL+C` or type `q` to stop the application.
194194

195195
=== JDBC
196196

197-
The https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/jdbc/library[JDBC instrumentation] will add a span for each JDBC queries done by your application, to enable it, add the following dependency to your build file:
197+
The https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/jdbc/library[JDBC instrumentation] bundled with this extension will add a span for each JDBC queries done by your application.
198198

199-
[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
200-
.pom.xml
201-
----
202-
<dependency>
203-
<groupId>io.opentelemetry.instrumentation</groupId>
204-
<artifactId>opentelemetry-jdbc</artifactId>
205-
</dependency>
206-
----
207-
208-
[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
209-
.build.gradle
210-
----
211-
implementation("io.opentelemetry.instrumentation:opentelemetry-jdbc")
212-
----
213-
214-
As it uses a dedicated JDBC datasource wrapper, you must enable telemetry for your datasource:
199+
As it uses a dedicated JDBC datasource wrapper, you must enable telemetry for your datasource with the `quarkus.datasource.jdbc.telemetry` property, as in the following example:
215200

216201
[source, properties]
217202
----

extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSourceJdbcBuildTimeConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ public interface DataSourceJdbcBuildTimeConfig {
3434
/**
3535
* Enable datasource metrics collection. If unspecified, collecting metrics will be enabled by default if
3636
* a metrics extension is active.
37+
* <p>
38+
* Deprecated. This was used by the now deprecated quarkus-smallrye-metrics and will be removed soon.
39+
* <p>
40+
* Please use quarkus-micrometer and the quarkus.datasource.metrics.enabled property
3741
*/
42+
@Deprecated(forRemoval = true)
3843
Optional<Boolean> enableMetrics();
3944

4045
/**

extensions/opentelemetry/deployment/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@
130130
<artifactId>quarkus-agroal-deployment</artifactId>
131131
<scope>test</scope>
132132
</dependency>
133-
<dependency>
134-
<groupId>io.opentelemetry.instrumentation</groupId>
135-
<artifactId>opentelemetry-jdbc</artifactId>
136-
<scope>test</scope>
137-
</dependency>
138133
<dependency>
139134
<groupId>io.quarkus</groupId>
140135
<artifactId>quarkus-jdbc-h2-deployment</artifactId>

extensions/opentelemetry/runtime/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@
198198
</exclusion>
199199
</exclusions>
200200
</dependency>
201+
<dependency>
202+
<groupId>io.opentelemetry.instrumentation</groupId>
203+
<artifactId>opentelemetry-jdbc</artifactId>
204+
</dependency>
201205

202206
<!-- Test Dependencies -->
203207
<dependency>

integration-tests/opentelemetry-jdbc-instrumentation/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
</dependency>
3333

3434
<!-- JDBC instrumentation -->
35-
<dependency>
36-
<groupId>io.opentelemetry.instrumentation</groupId>
37-
<artifactId>opentelemetry-jdbc</artifactId>
38-
</dependency>
3935
<dependency>
4036
<groupId>io.quarkus</groupId>
4137
<artifactId>quarkus-jdbc-oracle</artifactId>

0 commit comments

Comments
 (0)