Crons lead to unusual 10% load increase
Integration
sentry-spring-boot-starter-jakarta
Java Version
Spring boot 3.2.2
Version
7.2.0
Steps to Reproduce
spring boot application 3.2.2 annotation: @SentryCheckIn(value = "x", heartbeat = true) SDK version: io.sentry:sentry-spring-boot-starter-jakarta:7.2.0 Looks like that the gc_memory_promoted_bytes_total is much higher than usual
Expected Result
Not a big increase in load increase
Actual Result
I’ve noticed that enabling the cron SDK in our Spring Boot application leads to an unusual 10% load increase on one of the three instances in our cluster. This behavior is apparent even when the scheduler isn’t active, as it’s set to run in the morning.
┆Issue is synchronized with this Jira Improvement by Unito
@Angelodaniel do you know if other Sentry annotations have been used before (e.g. @SentrySpan, @SentryTransaction) or if crons is the first AOP feature in use?
I'll try to reproduce and see if there's something we can do about it.
@Angelodaniel is there only a single @Scheduled method that runs in the morning and nothing else?
@Angelodaniel does this only happen when the server has been running for a while or can it be observed immediately?
@Angelodaniel is the method annotated with @SentryCheckIn also called from other places? e.g. when a request is performed?
sorry for the many separate messages
As a workaround, you could try to use CheckInUtils.withCheckIn instead of the annotation and see if that helps. See https://docs.sentry.io/platforms/java/crons/#check-ins-recommended
If that alone doesn't work, you might have to combine it with sentry.enable-aot-compatibility=true to disable AOP features. Be aware though this also disabled other Sentry annotations like @SentryTransaction and @SentrySpan.
Hello, I can jump in here and answer your questions @Angelodaniel
@Angelodaniel do you know if other Sentry annotations have been used before (e.g.
@SentrySpan,@SentryTransaction) or if crons is the first AOP feature in use?I'll try to reproduce and see if there's something we can do about it.
Only the @SentryCheckIn was used.
@Angelodaniel is there only a single @Scheduled method that runs in the morning and nothing else? No we have multiple Scheduler running, but only one got the @SentryCheckIn Annotation.
@Angelodaniel is the method annotated with @SentryCheckIn also called from other places? e.g. when a request is performed? nope, only via Scheduler Annotation
@Angelodaniel does this only happen when the server has been running for a while or can it be observed immediately?
immediately
@stockii thank you for your answers, we'll investigate and report back here.
@stockii so far I haven't been able to confirm the load increase on our Spring Boot 3 sample. Have you had any luck with the workaround in https://github.com/getsentry/sentry-java/issues/3165#issuecomment-1912000869 ?