-
Notifications
You must be signed in to change notification settings - Fork 858
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
All spans are broken if R2dbcEntityTemplate or CoroutineCrudRepository was used in the code #5543
Comments
+1 |
💯 |
The same problem happens when CoroutineCrudRepository is used.
|
I found the solution how to fix spans, but it is not a good one:
And env params listed below:
|
There are (at least) three places where things could be going wrong, only one of which would apply to this repositories codebase:
It would be helpful if you could narrow things down a bit on this, since only option 1) would apply to this codebase. |
Hello @jkwatson But if you have Coroutine Flow which emits more than one item, you will see spans which don't have correct parents and are measured incorrectly: |
That sounds like it's an instrumentation issue, then, and not an issue for the core libraries. Can you open an issue in the instrumentation repository for this? |
@jkwatson thank you for a reply. https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues - is this a correct place to create an issue? |
Closing now that issue has been moved over to opentelemetry-java-instrumentation |
Description:
We have a project which uses GraphQL, Spring, Kotlin coroutines. For DB interactions org.springframework.data.r2dbc.core.R2dbcEntityTemplate is used. It can return or coroutine Flow or Spring Flux/Mono.
If r2dbcEntityTemplate is used, the trace looks like this:
If we return List it will be different :
Steps to reproduce
Gradle dependencies:
Configuration:
We will create a simple chain:
SampleItemFetcher(GraphQL) -> SampleItemService(Spring) -> EntityRepository(Spring) -> EntityRepository (uses R2dbcEntityTemplate)
Code is described below:
schema.graphql:
SampleItemFetcher:
SampleItemService:
SampleItemServiceImpl:
EntityRepository:
EntityRepositoryImpl:
DBRepository:
DBRepositoryImpl:
What did you expect to see?
Spans should contain the correct ones.
What did you see instead?
In broken trace RepoImpl.getAll is shown separately, but it should be a part of the parent span.
What version and what artefacts are you using?
Environment
macOS, tested locally
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: