open-telemetry / opentelemetry-java-instrumentation

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

JDBC - Add OTEL span attributes for number of rows returned/affected by query #10129

Open doppleware opened 9 months ago

doppleware commented 9 months ago

Is your feature request related to a problem? Please describe.

Not directly a problem but I am trying to draw correlations between performance problems and number of rows returned by query

Describe the solution you'd like

Similar to the Micrometer implementation: https://jdbc-observations.github.io/datasource-micrometer/docs/current/docs/html/#observability-spans It would be awesome to see the attributes jdbc.row-affected jdbc.row-count on the db spans.

Describe alternatives you've considered

No response

Additional context

No response

AlchemyDing commented 8 months ago

I think this is a good idea, but the attribute name need to be considered.

trask commented 8 months ago

linking to related: https://github.com/open-telemetry/semantic-conventions/issues/440