Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3b2debe
checkin
adinauer Sep 11, 2023
1de0ba7
Add trace context, release and env; factory methods; fix serializatio…
adinauer Sep 12, 2023
3dd4fce
add tests
adinauer Sep 13, 2023
41cd16d
remove serial version uid
adinauer Sep 13, 2023
97b8e63
Merge branch 'main' into feat/crons
adinauer Sep 13, 2023
083e021
add back serial version uid
adinauer Sep 13, 2023
4828fa3
quartz support for spring jakarta
adinauer Sep 15, 2023
ef54e76
changelog
adinauer Sep 15, 2023
cc23d3c
code review changes; add sample code to spring scheduled job
adinauer Sep 15, 2023
6038dc5
Merge branch 'feat/crons' into feat/crons-quartz
adinauer Sep 15, 2023
44a3c75
add checkin example to scheduled job
adinauer Sep 15, 2023
b558570
Merge branch 'feat/crons' into feat/crons-quartz
adinauer Sep 15, 2023
0c29f12
Move quartz job listener into a separate module
adinauer Sep 18, 2023
24215e5
add quartz auto config to spring boot 2
adinauer Sep 19, 2023
68931af
Merge branch 'main' into feat/crons-quartz
adinauer Sep 19, 2023
a709a40
fix comment
adinauer Sep 19, 2023
372a2f0
Add enableAutomaticCheckIns and ignoreCheckIns options
adinauer Sep 20, 2023
66cb754
move __ slug logic
adinauer Sep 20, 2023
f4fb1dd
fix sample by adding quartz lib
adinauer Sep 20, 2023
2e7fb74
Merge branch 'feat/crons-quartz' into feat/crons-options
adinauer Sep 20, 2023
86e5ded
changelog
adinauer Sep 20, 2023
409827e
mark crons features experimental
adinauer Sep 20, 2023
c420272
code review changes
adinauer Sep 22, 2023
fc2a884
ignore unused monitors
adinauer Sep 22, 2023
05f222d
Merge branch 'feat/crons-options' into feat/crons-experimental
adinauer Sep 22, 2023
7c8c65c
add missing annotations
adinauer Sep 22, 2023
522a7b5
Merge branch 'feat/crons-lib-support' into feat/crons-experimental
adinauer Sep 25, 2023
a0c8886
Merge branch 'feat/crons-lib-support' into feat/crons-experimental
adinauer Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.sentry.protocol.SentryId;
import java.util.List;
import java.util.TimeZone;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.quartz.CalendarIntervalTrigger;
Expand All @@ -26,6 +27,7 @@
import org.quartz.SimpleTrigger;
import org.quartz.Trigger;

@ApiStatus.Experimental
public final class SentryJobListener implements JobListener {

public static final String SENTRY_CHECK_IN_ID_KEY = "sentry-checkin-id";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package io.sentry.spring.jakarta.checkin;

import com.jakewharton.nopen.annotation.Open;
import org.jetbrains.annotations.ApiStatus;
import org.springframework.boot.autoconfigure.quartz.SchedulerFactoryBeanCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@Open
@ApiStatus.Experimental
public class SentryQuartzConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.sentry.spring.jakarta.checkin;

import io.sentry.quartz.SentryJobListener;
import org.jetbrains.annotations.ApiStatus;
import org.springframework.boot.autoconfigure.quartz.SchedulerFactoryBeanCustomizer;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

@ApiStatus.Experimental
public final class SentrySchedulerFactoryBeanCustomizer implements SchedulerFactoryBeanCustomizer {
@Override
public void customize(SchedulerFactoryBean schedulerFactoryBean) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package io.sentry.spring.checkin;

import com.jakewharton.nopen.annotation.Open;
import org.jetbrains.annotations.ApiStatus;
import org.springframework.boot.autoconfigure.quartz.SchedulerFactoryBeanCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@Open
@ApiStatus.Experimental
public class SentryQuartzConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.sentry.spring.checkin;

import io.sentry.quartz.SentryJobListener;
import org.jetbrains.annotations.ApiStatus;
import org.springframework.boot.autoconfigure.quartz.SchedulerFactoryBeanCustomizer;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

@ApiStatus.Experimental
public final class SentrySchedulerFactoryBeanCustomizer implements SchedulerFactoryBeanCustomizer {
@Override
public void customize(SchedulerFactoryBean schedulerFactoryBean) {
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/CheckIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@ApiStatus.Experimental
/** A check-in for a monitor (CRON). */
public final class CheckIn implements JsonUnknown, JsonSerializable {

Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/CheckInStatus.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.sentry;

import java.util.Locale;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/** Status of a CheckIn */
@ApiStatus.Experimental
public enum CheckInStatus {
IN_PROGRESS,
OK,
Expand Down
5 changes: 5 additions & 0 deletions sentry/src/main/java/io/sentry/ExternalOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -392,18 +393,22 @@ public void setSendModules(final @Nullable Boolean sendModules) {
this.sendModules = sendModules;
}

@ApiStatus.Experimental
public @Nullable Boolean isEnableAutomaticCheckIns() {
return enableAutomaticCheckIns;
}

@ApiStatus.Experimental
public void setEnableAutomaticCheckIns(final @Nullable Boolean enableAutomaticCheckIns) {
this.enableAutomaticCheckIns = enableAutomaticCheckIns;
}

@ApiStatus.Experimental
public void setIgnoredCheckIns(final @Nullable List<String> ignoredCheckIns) {
this.ignoredCheckIns = ignoredCheckIns;
}

@ApiStatus.Experimental
public @Nullable List<String> getIgnoredCheckIns() {
return ignoredCheckIns;
}
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/Hub.java
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ private Scope buildLocalScope(
}

@Override
@ApiStatus.Experimental
public @NotNull SentryId captureCheckIn(final @NotNull CheckIn checkIn) {
SentryId sentryId = SentryId.EMPTY_ID;
if (!isEnabled()) {
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/HubAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public void reportFullyDisplayed() {
}

@Override
@ApiStatus.Experimental
public @NotNull SentryId captureCheckIn(final @NotNull CheckIn checkIn) {
return Sentry.captureCheckIn(checkIn);
}
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/IHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ TransactionContext continueTrace(
@Nullable
BaggageHeader getBaggage();

@ApiStatus.Experimental
@NotNull
SentryId captureCheckIn(final @NotNull CheckIn checkIn);
}
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/ISentryClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,6 @@ SentryId captureTransaction(
}

@NotNull
@ApiStatus.Experimental
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the @ApiStatus.Experimental Annotation is missing on the SentryClient.java class

SentryId captureCheckIn(@NotNull CheckIn checkIn, @Nullable Scope scope, @Nullable Hint hint);
}
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/MonitorConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@ApiStatus.Experimental
public final class MonitorConfig implements JsonUnknown, JsonSerializable {

private @NotNull MonitorSchedule schedule;
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/MonitorContexts.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@ApiStatus.Experimental
public final class MonitorContexts extends ConcurrentHashMap<String, Object>
implements JsonSerializable {
private static final long serialVersionUID = 3987329379811822556L;
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/MonitorSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@ApiStatus.Experimental
public final class MonitorSchedule implements JsonUnknown, JsonSerializable {

public static @NotNull MonitorSchedule crontab(final @NotNull String value) {
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/MonitorScheduleType.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.sentry;

import java.util.Locale;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/** Type of a monitor schedule */
@ApiStatus.Experimental
public enum MonitorScheduleType {
CRONTAB,
INTERVAL;
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/MonitorScheduleUnit.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.sentry;

import java.util.Locale;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/** Time unit of a monitor schedule. */
@ApiStatus.Experimental
public enum MonitorScheduleUnit {
MINUTE,
HOUR,
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/NoOpHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io.sentry.protocol.SentryTransaction;
import io.sentry.protocol.User;
import java.util.List;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -209,6 +210,7 @@ public void reportFullyDisplayed() {}
}

@Override
@ApiStatus.Experimental
public @NotNull SentryId captureCheckIn(final @NotNull CheckIn checkIn) {
return SentryId.EMPTY_ID;
}
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/NoOpSentryClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.sentry.protocol.SentryId;
import io.sentry.protocol.SentryTransaction;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -54,6 +55,7 @@ public SentryId captureEnvelope(@NotNull SentryEnvelope envelope, @Nullable Hint
}

@Override
@ApiStatus.Experimental
public @NotNull SentryId captureCheckIn(
@NotNull CheckIn checkIn, @Nullable Scope scope, @Nullable Hint hint) {
return SentryId.EMPTY_ID;
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/Sentry.java
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ public interface OptionsConfiguration<T extends SentryOptions> {
return getCurrentHub().getBaggage();
}

@ApiStatus.Experimental
public static @NotNull SentryId captureCheckIn(final @NotNull CheckIn checkIn) {
return getCurrentHub().captureCheckIn(checkIn);
}
Expand Down
1 change: 1 addition & 0 deletions sentry/src/main/java/io/sentry/SentryClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ public void captureSession(final @NotNull Session session, final @Nullable Hint
}

@Override
@ApiStatus.Experimental
public @NotNull SentryId captureCheckIn(
@NotNull CheckIn checkIn, final @Nullable Scope scope, @Nullable Hint hint) {
if (hint == null) {
Expand Down
8 changes: 6 additions & 2 deletions sentry/src/main/java/io/sentry/SentryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,10 @@ public class SentryOptions {
private boolean sendModules = true;

/** Whether to automatically send check-ins for monitors (CRONS). */
private boolean enableAutomaticCheckIns = false;
@ApiStatus.Experimental private boolean enableAutomaticCheckIns = false;

/** Contains a list of monitor slugs for which check-ins should not be sent. */
private @Nullable List<String> ignoredCheckIns = null;
@ApiStatus.Experimental private @Nullable List<String> ignoredCheckIns = null;

/**
* Adds an event processor
Expand Down Expand Up @@ -2152,6 +2152,7 @@ public boolean isSendModules() {
*
* @return true if check-ins should be sent automatically.
*/
@ApiStatus.Experimental
public boolean isEnableAutomaticCheckIns() {
return enableAutomaticCheckIns;
}
Expand Down Expand Up @@ -2179,10 +2180,12 @@ public void setSendModules(boolean sendModules) {
*
* @param enableAutomaticCheckIns true if check-ins should be sent automatically.
*/
@ApiStatus.Experimental
public void setEnableAutomaticCheckIns(boolean enableAutomaticCheckIns) {
this.enableAutomaticCheckIns = enableAutomaticCheckIns;
}

@ApiStatus.Experimental
public void setIgnoredCheckIns(final @Nullable List<String> ignoredCheckIns) {
if (ignoredCheckIns == null) {
this.ignoredCheckIns = null;
Expand All @@ -2198,6 +2201,7 @@ public void setIgnoredCheckIns(final @Nullable List<String> ignoredCheckIns) {
}
}

@ApiStatus.Experimental
public @Nullable List<String> getIgnoredCheckIns() {
return ignoredCheckIns;
}
Expand Down