| name | spring-boot-jdbc-tracing | |||||
|---|---|---|---|---|---|---|
| description | Spring Boot sample for Oracle JDBC tracing with OpenTelemetry. | |||||
| tags |
|
|||||
| blog_post | https://andersswanson.dev/2025/10/10/oracle-jdbc-tracing-with-spring-boot-opentelemetry/ |
This example application demonstrates how to instrument Oracle AI Database JDBC connections from a Spring Boot app context with OpenTelemetry.
- Java 21+, Maven
- Docker compatible environment with docker-compose
Start the Oracle AI Database Free and Zipkin containers with docker-compose:
docker-compose -dWhen the database starts, the grant_permissions.sql is run, creating a test user and a table.
This command starts the Java application:
mvn spring-boot:runPOST to the app's REST API to create a trace, starting with a span for the HTTP invocation that drops into the JDBC/database layer:
curl -X POST http://localhost:8080/flavors \
-H "Content-Type: application/json" \
-d '{"flavor": "Mint Chocolate Chip"}'- Navigate to the Grafana Tracing UI, using the container URL
http://localhost:3000/a/grafana-exploretraces-app - Click "Traces" to find all traces, or search for a specific trace ID
- View the trace! You can see HTTP request down to database query from a single trace
Set this property to true to enable the provider. Enabled by default.
Set this property to true to export sensitive data, like SQL query text. Disabled by default.