open-telemetry / opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java
https://opentelemetry.io
Apache License 2.0
1.94k stars 851 forks source link

Instrument vertx-sql-client #7018

Open dwipeshmishra opened 1 year ago

dwipeshmishra commented 1 year ago

Describe the bug Not getting DB traces for java Vertx Version: 3.9.2 while auto-instrumenting application with opentelemetry but getting DB traces using same configuration for Vertx Version: 3.7.1

Steps to reproduce Otel Configuration: -Dotel.resource.attributes=service.name=demo-service -Dotel.exporter.otlp.endpoint=http://localhost:4317 -Dotel.javaagent.debug=false -Dotel.metrics.exporter=none -Dotel.traces.exporter=otlp -Dotel.integration.jdbc-datasource.enabled=true

What did you expect to see? Was expecting to get mysql db traces but not getting in debug logs.

What did you see instead? DB traces were missing vertxAppWithoutDBTraces.txt

What version are you using? Otel Version: 1.18.0

Environment Compiler: 11.0.15 OS: Mac OS 12.5.1

trask commented 1 year ago

hi @dwipeshmishra! can you attach an example from the debug logs of the jdbc telemetry that you are seeing under vertx 3.7.1?

dwipeshmishra commented 1 year ago

@trask Debug logs for Vertx Version: 3.7.1 vertxAppWithDBTraces.txt

jsuereth commented 1 year ago

@trask Do we implement instrumentation for https://github.com/eclipse-vertx/vertx-sql-client yet? I think this might be a feature request.

trask commented 1 year ago

ah, no we don't 👍

PhilKes commented 1 year ago

@dwipeshmishra from what I see they already wrote an otel-instrumentation for their http and sql clients vertx-tracing outside of this repo.

I tried it out locally with vertx-mysql-client:4.3.8 using https://vertx.io/docs/vertx-opentelemetry/java/ and the span gets created: image