Tags from JDBC spans
rafal-dudek opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
JDBC query spans don't contain much useful information. Currently they have only tags: jdbc.query, jdbc.row-count (depending on operation).
https://github.com/spring-cloud/spring-cloud-sleuth/blob/3.1.x/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/jdbc/SleuthJdbcSpan.java#L119
Describe the solution you'd like
We would like to have more useful tags in JDBC spans. Opentelemetry standard describes many useful tags for db systems:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md
Some of useful tags would be:
db.system, db.name, db.user, net.peer.name, db.statement (the same as jdbc.query), db.operation.
Describe alternatives you've considered
Alternative solution would be mechanism to alter tags for JDBC spans similar to brave HttpRequestParser and HttpResponseParser which is for Http Spans. This will allow users to include in tags everything that is useful for them.
I think this is in general applicable to most of the instrumentations in sleuth. For example mongodb is also missing a lot of tags that are defined by opentelemetry. For some spans it is easy to customize them but for other, though, the customizers lack a lot of necessary informations in order to be customized properly.
Sleuth is feature complete. You can migrate to using Micrometer Observation API (with Spring Boot 3.0) e.g. via the Datasource Micrometer project (https://github.com/jdbc-observations/datasource-micrometer) that contains more tags.