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
Sentry-graphql does not send any GraphQL operations as transactions #3277
Comments
Hello @Andrevmatias I just tested using our Spring Boot 2 sample and there's a transaction for the request which the GraphQL span is attached to. Maybe you can spot a difference to your setup by looking at our sample. You can also attach a debugger to |
Thanks @adinauer! The only difference I noticed is that we use the The |
@Andrevmatias sentry-java/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryTracingFilter.java Line 126 in 695d3a3
Can you add a breakpoint there and see what's happening? |
It never reaches this line while resolving GraphQL requests because It happens because the request does not have the Looking at the code, even if this attribute is set, all the GraphQL requests would be grouped into the I implemented a custom So, two questions:
|
There's cases where this attribute is not set, it seems your setup is one of them (Maybe because you don't have Spring WebMVC?). Event then yes, it'd only set
Currently no. I think you best option at the moment is to implement your own Sorry I don't have a better solution at the moment. If something comes to mind, I'll update here. The following will require some SDK changes.
Ideas to make promoting spans to transactions easier in the future:
|
I do have Spring WebMVC. Calls to REST Controllers are sent correctly but I think the attribute is not set when using the For future reference, my solution was to implement my own @Bean
fun transactionNameProvider() = TransactionNameProvider {
val pattern = it.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE) as String?
"${it.method} ${pattern ?: it.requestURI}"
} About splitting into multiple transactions: As the transactions were not being finished, I implemented a custom |
Integration
sentry-graphql
Java Version
17
Version
7.6.0
Steps to Reproduce
Using Spring Boot 2.7.8 and the spring boot sentry integration.
Instrumentation configuration:
application.properties
Expected Result
Sentry should send all GraphQL requests as transactions and spans for each query/mutation field.
Actual Result
No GraphQL transaction is being sent. Other transactions are working fine. The Debug info also does not show any GraphQL transaction.
Trying to figure out what was happening I investigated the
SentryInstrumentation
class and couldn't find where the transaction is supposed to be finished. I only found routines to finish the spans.The text was updated successfully, but these errors were encountered: