Skip to content

Commit 05f222d

Browse files
committed
Merge branch 'feat/crons-options' into feat/crons-experimental
2 parents 409827e + fc2a884 commit 05f222d

File tree

6 files changed

+42
-2
lines changed

6 files changed

+42
-2
lines changed

sentry-samples/sentry-samples-spring-boot-jakarta/src/main/resources/application.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ sentry.logging.minimum-breadcrumb-level=debug
1010
# Performance configuration
1111
sentry.traces-sample-rate=1.0
1212
sentry.enable-tracing=true
13+
sentry.enable-automatic-checkins=true
14+
sentry.ignored-checkins=ignored_monitor_slug_1,ignored_monitor_slug_2
1315
sentry.debug=true
1416
in-app-includes="io.sentry.samples"
1517

sentry-samples/sentry-samples-spring-boot/src/main/resources/application.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ sentry.logging.minimum-breadcrumb-level=debug
1010
# Performance configuration
1111
sentry.traces-sample-rate=1.0
1212
sentry.enable-tracing=true
13-
#sentry.enable-automatic-checkins=true
13+
sentry.enable-automatic-checkins=true
14+
sentry.ignored-checkins=ignored_monitor_slug_1,ignored_monitor_slug_2
1415
sentry.debug=true
1516
in-app-includes="io.sentry.samples"
1617

sentry-spring-boot-jakarta/src/test/kotlin/io/sentry/spring/boot/jakarta/SentryAutoConfigurationTest.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,22 @@ class SentryAutoConfigurationTest {
767767
}
768768
}
769769

770+
@Test
771+
fun `when auto checkins is disabled, does not create quartz config`() {
772+
contextRunner.withPropertyValues("sentry.dsn=http://key@localhost/proj", "sentry.enable-automatic-checkins=false")
773+
.run {
774+
assertThat(it).doesNotHaveBean(SchedulerFactoryBeanCustomizer::class.java)
775+
}
776+
}
777+
778+
@Test
779+
fun `when auto checkins option is skipped, does not create quartz config`() {
780+
contextRunner.withPropertyValues("sentry.dsn=http://key@localhost/proj")
781+
.run {
782+
assertThat(it).doesNotHaveBean(SchedulerFactoryBeanCustomizer::class.java)
783+
}
784+
}
785+
770786
@Configuration(proxyBeanMethods = false)
771787
open class CustomOptionsConfigurationConfiguration {
772788

sentry-spring-boot/src/test/kotlin/io/sentry/spring/boot/SentryAutoConfigurationTest.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,22 @@ class SentryAutoConfigurationTest {
767767
}
768768
}
769769

770+
@Test
771+
fun `when auto checkins is disabled, does not create quartz config`() {
772+
contextRunner.withPropertyValues("sentry.dsn=http://key@localhost/proj", "sentry.enable-automatic-checkins=false")
773+
.run {
774+
assertThat(it).doesNotHaveBean(SchedulerFactoryBeanCustomizer::class.java)
775+
}
776+
}
777+
778+
@Test
779+
fun `when auto checkins option is skipped, does not create quartz config`() {
780+
contextRunner.withPropertyValues("sentry.dsn=http://key@localhost/proj")
781+
.run {
782+
assertThat(it).doesNotHaveBean(SchedulerFactoryBeanCustomizer::class.java)
783+
}
784+
}
785+
770786
@Configuration(proxyBeanMethods = false)
771787
open class CustomOptionsConfigurationConfiguration {
772788

sentry/src/main/java/io/sentry/SentryOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2460,7 +2460,7 @@ public void merge(final @NotNull ExternalOptions options) {
24602460
}
24612461
if (options.getIgnoredCheckIns() != null) {
24622462
final List<String> ignoredCheckIns = new ArrayList<>(options.getIgnoredCheckIns());
2463-
setTracePropagationTargets(ignoredCheckIns);
2463+
setIgnoredCheckIns(ignoredCheckIns);
24642464
}
24652465
}
24662466

sentry/src/test/java/io/sentry/SentryOptionsTest.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ class SentryOptionsTest {
371371
externalOptions.isEnabled = false
372372
externalOptions.isEnablePrettySerializationOutput = false
373373
externalOptions.isSendModules = false
374+
externalOptions.isEnableAutomaticCheckIns = true
375+
externalOptions.ignoredCheckIns = listOf("slug1", "slug-B")
376+
374377
val options = SentryOptions()
375378

376379
options.merge(externalOptions)
@@ -398,6 +401,8 @@ class SentryOptionsTest {
398401
assertFalse(options.isEnabled)
399402
assertFalse(options.isEnablePrettySerializationOutput)
400403
assertFalse(options.isSendModules)
404+
assertTrue(options.isEnableAutomaticCheckIns)
405+
assertEquals(listOf("slug1", "slug-B"), options.ignoredCheckIns)
401406
}
402407

403408
@Test

0 commit comments

Comments
 (0)