Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring/Hibernate - Spans out of order #4633

Closed
JBodkin-LH opened this issue Nov 11, 2021 · 3 comments
Closed

Spring/Hibernate - Spans out of order #4633

JBodkin-LH opened this issue Nov 11, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@JBodkin-LH
Copy link

Describe the bug
By default, Spring enables spring.jpa.open-in-view which creates a Hibernate session for every request. When this property is enabled, we're seeing SELECT statements being attached to the Hibernate session span instead of the Spring WebMVC span.

What did you expect to see?
The spans in the following order:

  1. Session
  2. OurSpringRestController.ourMethod
    ...
  3. OurSpringDataRepository.findAllByLocale
  4. SELECT some model
  5. SELECT some table
  6. OurSpringDataRepository.findAll
  7. SELECT some model
  8. SELECT some table

What did you see instead?
The spans in the following order:

  1. Session
  2. SELECT some model
  3. SELECT some table
  4. SELECT some model
  5. SELECT some table
  6. OurSpringRestController.ourMethod
    ...
  7. OurSpringDataRepository.findAllByLocale
  8. OurSpringDataRepository.findAll

What version are you using?
v1.7.2

Environment
Compiler: AdoptOpenJDK 11.0.10-hotspot
OS: Docker - marketplace.gcr.io/google/centos7:latest
Runtime (if different from JDK above): AdoptOpenJDK 11.0.10-hotspot
OS (if different from OS compiled on): Docker - marketplace.gcr.io/google/centos7:latest

Additional context
image

@JBodkin-LH JBodkin-LH added the bug Something isn't working label Nov 11, 2021
@trask
Copy link
Member

trask commented Nov 11, 2021

hi @JBodkin-LH! I think #4538 probably addresses this, can you try out the latest snapshot build? https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/CONTRIBUTING.md#snapshot-builds

@JBodkin-LH
Copy link
Author

Yes, it does address the issue. Is there a way of tracking when the next release is that includes this commit?

@mateuszrzeszutek
Copy link
Member

Yes, it does address the issue. Is there a way of tracking when the next release is that includes this commit?

The 1.9.0 release will include that fix; it will most likely happen at the end of next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants