Skip to content

Commit

Permalink
mark crons features experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
adinauer committed Sep 20, 2023
1 parent 86e5ded commit 409827e
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.sentry.util.Objects;
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 @@ -29,6 +30,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
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
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
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

0 comments on commit 409827e

Please sign in to comment.