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

Tracing for Spring Data CoroutineCrudRepository methods is timed incorrectly #11035

Open
ofelbaum opened this issue Apr 5, 2024 · 2 comments · Fixed by #11168 or #11583
Open

Tracing for Spring Data CoroutineCrudRepository methods is timed incorrectly #11035

ofelbaum opened this issue Apr 5, 2024 · 2 comments · Fixed by #11168 or #11583
Labels
bug Something isn't working needs triage New issue that requires triage

Comments

@ofelbaum
Copy link

ofelbaum commented Apr 5, 2024

Describe the bug

It looks like traces collected for Spring Data repositories (backed by CoroutineCrudRepository) are reflecting just "assembly" phase. They typically are measured in microseconds (μs).

Steps to reproduce

Here is the project to demonstrate the issue https://github.com/ofelbaum/r2dbc-coroutine-demo

Expected behavior

Span duration for spans collected by "io.opentelemetry.spring-data" instrumentation is reflecting actual duration of an RDBMS operation

Actual behavior

Span duration for spans collected by "io.opentelemetry.spring-data" instrumentation is not reflecting actual duration of an RDBMS operation

Javaagent or library instrumentation version

https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.2.0/opentelemetry-javaagent.jar

Environment

JDK: Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
OS: macOS 14.2.1

Additional context

Looks like this issue is closely related to another #9500

@ofelbaum ofelbaum added bug Something isn't working needs triage New issue that requires triage labels Apr 5, 2024
@ofelbaum
Copy link
Author

@laurit Thanks. I appreciate your help with fixing this.

As it was mentioned the issue might be fixed in #11168.
I upgraded javaagent library from 2.2.0 to 2.4.0 in sample demo I prepared, but still have the issue :(

@ofelbaum
Copy link
Author

@laurit Hello. It's me again :)

Just checked out new version 2.5.0 of javaagent with fix of this issue.
Looks like it resolved partially. Span generated for CoroutineCrudRepository.findAll looks great, but span for CoroutineCrudRepository.findById still broken (splitted and has wrong duration).

Could you please take a look once again?

Sample demo updated with recent findings.

@laurit laurit reopened this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage
Projects
None yet
2 participants