Skip to content

Commit

Permalink
Add JavaDoc to `SentryOptions.ignoredTransactions,ignoredSpanOrigins,…
Browse files Browse the repository at this point in the history
…ignoredCheckIns`
  • Loading branch information
lcian committed Jan 27, 2025
1 parent 29a4185 commit c24feb7
Showing 1 changed file with 63 additions and 2 deletions.
65 changes: 63 additions & 2 deletions sentry/src/main/java/io/sentry/SentryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,19 @@ public class SentryOptions {
/** Whether to enable scope persistence so the scope values are preserved if the process dies */
private boolean enableScopePersistence = true;

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

/** Contains a list of span origins for which spans / transactions should not be created. */
/**
* Strings or regex patterns that the name of a new span/transaction will be tested against. If
* there is a match, the span/transaction will not be created.
*/
@ApiStatus.Experimental private @Nullable List<FilterString> ignoredSpanOrigins = null;

/**
* Strings or regex patterns that captured transaction names will be tested against. If there is a
* match, the transaction will not be sent to Sentry.
*/
private @Nullable List<FilterString> ignoredTransactions = null;

@ApiStatus.Experimental
Expand Down Expand Up @@ -2238,11 +2245,24 @@ public void setSendModules(boolean sendModules) {
this.sendModules = sendModules;
}

/**
* Returns the list of strings/regex patterns the name of a new span/transaction will be tested
* against to determine whether the span/transaction shall be created.
*
* @return the list of strings or regex patterns the name of a new span/transaction will be tested
* against. If there is a match, the span/transaction will not be created.
*/
@ApiStatus.Experimental
public @Nullable List<FilterString> getIgnoredSpanOrigins() {
return ignoredSpanOrigins;
}

/**
* Adds an item to the list of strings/regex patterns the name of a new span/transaction will be
* tested against to determine whether the span/transaction shall be created.
*
* @param ignoredSpanOrigin the string/regex pattern
*/
@ApiStatus.Experimental
public void addIgnoredSpanOrigin(String ignoredSpanOrigin) {
if (ignoredSpanOrigins == null) {
Expand All @@ -2251,6 +2271,12 @@ public void addIgnoredSpanOrigin(String ignoredSpanOrigin) {
ignoredSpanOrigins.add(new FilterString(ignoredSpanOrigin));
}

/**
* Sets the list of strings/regex patterns the name of a new span/transaction will be tested
* against to determine whether the span/transaction shall be created.
*
* @param ignoredSpanOrigins the list of strings/regex patterns
*/
@ApiStatus.Experimental
public void setIgnoredSpanOrigins(final @Nullable List<String> ignoredSpanOrigins) {
if (ignoredSpanOrigins == null) {
Expand All @@ -2267,11 +2293,22 @@ public void setIgnoredSpanOrigins(final @Nullable List<String> ignoredSpanOrigin
}
}

/**
* Returns the list of monitor slugs for which captured check-ins should not be sent to Sentry.
*
* @return the list of monitor slugs for which captured check-ins should not be sent to Sentry
*/
@ApiStatus.Experimental
public @Nullable List<FilterString> getIgnoredCheckIns() {
return ignoredCheckIns;
}

/**
* Adds a monitor slug to the list of slugs for which captured check-ins should not be sent to
* Sentry.
*
* @param ignoredCheckIn the monitor slug
*/
@ApiStatus.Experimental
public void addIgnoredCheckIn(String ignoredCheckIn) {
if (ignoredCheckIns == null) {
Expand All @@ -2280,6 +2317,11 @@ public void addIgnoredCheckIn(String ignoredCheckIn) {
ignoredCheckIns.add(new FilterString(ignoredCheckIn));
}

/**
* Sets the list of monitor slugs for which captured check-ins should not be sent to Sentry.
*
* @param ignoredCheckIns the list of monitor slugs for which check-ins should not be sent
*/
@ApiStatus.Experimental
public void setIgnoredCheckIns(final @Nullable List<String> ignoredCheckIns) {
if (ignoredCheckIns == null) {
Expand All @@ -2296,10 +2338,23 @@ public void setIgnoredCheckIns(final @Nullable List<String> ignoredCheckIns) {
}
}

/**
* Returns the list of strings/regex patterns that captured transaction names are checked against
* to determine if a transaction shall be sent to Sentry or ignored.
*
* @return the list of strings/regex patterns that captured transaction names are checked against
* to determine if a transaction shall be sent to Sentry or ignored.
*/
public @Nullable List<FilterString> getIgnoredTransactions() {
return ignoredTransactions;
}

/**
* Adds an element the list of strings/regex patterns that captured transaction names are checked
* against to determine if a transaction shall be sent to Sentry or ignored.
*
* @param ignoredTransaction the string/regex pattern
*/
@ApiStatus.Experimental
public void addIgnoredTransaction(String ignoredTransaction) {
if (ignoredTransactions == null) {
Expand All @@ -2308,6 +2363,12 @@ public void addIgnoredTransaction(String ignoredTransaction) {
ignoredTransactions.add(new FilterString(ignoredTransaction));
}

/**
* Sets the list of strings/regex patterns that captured transaction names are checked against to
* determine if a transaction shall be sent to Sentry or ignored.
*
* @param ignoredTransactions the list of string/regex patterns
*/
@ApiStatus.Experimental
public void setIgnoredTransactions(final @Nullable List<String> ignoredTransactions) {
if (ignoredTransactions == null) {
Expand Down

0 comments on commit c24feb7

Please sign in to comment.