Closed nikb1tamerfdp closed 2 days ago
I'm not sure where the trace is being created at. Generally, all JDBC/JPA instrumentation is happening outside of Spring Data JPA as this project expects an already configured EntityManager
with a potentially decorated DataSource
.
Paging @rstoyanchev (and @jonatan-ivanov). It could well be that the issue has its origin in Spring GraphQL or Spring Web. After poking a bit on the reproducer, wrapping the repository call within a TransactionTemplate
doesn't change anything, however, not calling the repository doesn't reproduce the issue.
I assume an issue somewhere between GraphQL and the DataSource
instrumentation.
I think this issue should be closed in favor of https://github.com/jdbc-observations/datasource-micrometer/issues/41
Alright, thanks for the pointer.
The context
In my application (Spring Boot
3.2.6
), I'm using the GraphQL, Web and JPA starters. I have created a GraphQL controller, in which I interact with a JPA repository. I have also enabled observability with Micrometer.The issue
When I query my controller, everything executes successfully, but I can find this log line (formatted for clarity purpose) :
When I connect my application to an Open Telemetry with a Jaeger backend, just to check if everything is ok in terms of trace and spans, it seems that yeah, everything is ok :![Issue - Jaeger](https://github.com/spring-projects/spring-boot/assets/15066513/daecce37-a5f0-4cc7-a3ba-6fc8deb80374)
This log is not generated if I remove interaction with my JPA repository. It's also not generated if I annotate the method of my controller (the one annotated with
@QueryMapping
) with@Observed
, or if I set the propertyspring.jpa.open-in-view
tofalse
(something I prefer not to do).How to reproduce
You can find a sample application right here.
You can query the controller with these information :
http://localhost:8080/graphql
Additional comments
In the original ticket that I've created on Spring Boot project side, @bclozel added this comment, maybe it can give more info :