Skip to content

Sentry-graphql does not send any GraphQL operations as transactions #3277

@Andrevmatias

Description

@Andrevmatias

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:

@Configuration
class SentryConfiguration(
    val tracingDataBuilder: TracingDataBuilder
) {
    @Bean
    fun sentryTracingInstrumentation() = SentryInstrumentation(
        { span: ISpan, env: DataFetchingEnvironment, _: Any? ->
            tracingDataBuilder.createTags(env.operationDefinition.operation.toString()).forEach { (key, value) ->
                span.setTag(key, value)
            }
            span
        },
        SentrySpringSubscriptionHandler(),
        false
    )

    @Bean
    fun beforeSendTransactionCallback() = BeforeSendTransactionCallback { sentryTransaction, _ ->
        if (excludedRoutes.contains(sentryTransaction.transaction)) {
            null
        } else {
            sentryTransaction
        }
    }
}

application.properties

sentry.enabled=true
sentry.debug=true
sentry.dsn=[dsn]
sentry.release[email protected]@
sentry.environment[email protected]@
sentry.traces-sample-rate=1.0

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.

Metadata

Metadata

Assignees

Labels

BugIssue type

Projects

Status

Needs Discussion

Status

No status

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions