spring-cloud-sleuth-instrumentation sql issue for spans
See original GitHub issueDescribe the bug
Version: 3.1.0
The TraceListenerStrategy
in spring-cloud-sleuth-instrumentation
throws a StringOutOfBoundsException
when the SQL consists of only one word, like: BEGIN
. Such word, afaik, constitutes a valid SQL statement, and as such should be handled without throwing an exception.
The exception is thrown here:
https://github.com/spring-cloud/spring-cloud-sleuth/blob/main/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/jdbc/TraceListenerStrategy.java#L432
(in spanName
method), as indexOf(' ')
is -1.
I’d suggest handling this with returning the whole SQL as span name in such case. Another option would be to ignore such SQL.
Sample N/A
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (20 by maintainers)
Top Results From Across the Web
Spring Cloud Sleuth Reference Documentation
A span name should depict an operation name. The name should be low cardinality, so it should not include identifiers. Since there is...
Read more >spring-cloud/spring-cloud-sleuth - Gitter
Hi. Started using Spring Integration tracing, and the traces seem a bit weird to me. Why is it neccessary to create a consumer...
Read more >Spring-Sleuth does not process have all instrumentation done ...
My alternate was to use Java Agent with Spring-Sleuth and it works, but the issue is tracing logs does not work. Somehow it...
Read more >Tracing with Spring Boot, OpenTelemetry, and Jaeger
A guide on how to set up your Spring Boot applications to emit ... The first span of a trace often re-uses the...
Read more >Spring Cloud Sleuth instrumentation constantly prints TODO ...
Until then you can set the logging level for that class to ERROR logging.level.org.springframework.cloud.sleuth.instrument.jdbc=ERROR.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gavlyukovskiy sounds reasonable to me, I’m happy to make that change to PR if you think that would be a best way to go.
You can check the tentative release dates here https://github.com/spring-cloud/spring-cloud-release/milestones