question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

spring-cloud-sleuth-instrumentation sql issue for spans

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
mschielmanncommented, Dec 21, 2021

@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.

1reaction
marcingrzejszczakcommented, Jan 3, 2022

You can check the tentative release dates here https://github.com/spring-cloud/spring-cloud-release/milestones

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found