Reputation: 15
I am using Sentry with a Spring Boot application, and I am trying to reduce the number of "Slow DB Query" events being sent to Sentry. Currently, my application sends a lot of these events, which clutters the Sentry dashboard and increases infrastructure costs.
Here are some key points about my setup:
application.yml
:sentry:
dsn: <my-dsn>
exception-resolver-order: -1
enable-user-interaction-tracing: true
sendDefaultPii: true
traces-sample-rate: 0.01 # 1% of traces are sampled
I want to prevent my application from sending these "Slow DB Query" spans to Sentry altogether. Specifically:
Can I filter out these spans on the client-side using beforeSendTransaction or another mechanism in Sentry's Java SDK?
If yes, how can I identify these spans and ensure they are not sent to Sentry?
Alternatively, is there another recommended approach to reduce the number of such events? Any help or code examples would be greatly appreciated. I use spring boot 2.7.16, postgreSQL, Java 17 and
<dependency>
<artifactId>sentry-spring-boot-starter</artifactId>
<version>6.33.1</version>
</dependency>
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-jdbc</artifactId>
<version>7.8.0</version>
</dependency>
Upvotes: 0
Views: 69