Skip to content

Commit

Permalink
Merge pull request #38342 from brunobat/datasource-docs
Browse files Browse the repository at this point in the history
Improve datasource tracing
  • Loading branch information
brunobat authored Jan 23, 2024
2 parents b179820 + ee21ad3 commit b7159fc
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion docs/src/main/asciidoc/datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ Without an extension, the driver will work correctly in any Quarkus app running
However, the driver is unlikely to work when compiling your application to a native executable.
If you plan to make a native executable, use the existing JDBC Quarkus extensions, or contribute one for your driver.

.An example with the OpenTracing driver:
[WARNING]
====
OpenTracing has been deprecated in favor of OpenTelemetry. For tracing information, please check the related section about <<datasource-tracing>>, bellow.
====

.A custom driver definition example with the legacy OpenTracing driver:

[source, properties]
----
Expand Down Expand Up @@ -534,6 +539,20 @@ They are available after calling `dataSource.getMetrics()` on an injected `Agroa

If the metrics collection for this datasource is disabled, all values result in zero.

[[datasource-tracing]]
=== Datasource tracing

To use tracing with a datasource, you need to add the xref:opentelemetry.adoc[`quarkus-opentelemetry`] extension to your project.

You don't need to declare a different driver because you need tracing. If you use a JDBC driver, you need to follow the instructions in the OpenTelemetry extension xref:opentelemetry.adoc#jdbc[here].

Even with all the tracing infrastructure in place the datasource tracing is not enabled by default, and you need to enable it by setting this property:
[source, properties]
----
# enable tracing
quarkus.datasource.jdbc.telemetry=true
----

=== Narayana transaction manager integration

Integration is automatic if the Narayana JTA extension is also available.
Expand Down

0 comments on commit b7159fc

Please sign in to comment.