Skip to content

Commit

Permalink
Merge pull request #179 from NickBeginner/main
Browse files Browse the repository at this point in the history
Add new config property for using "addInAppExclude" Sentry feature
  • Loading branch information
ia3andy authored Jan 25, 2024
2 parents e391125 + 49f879d commit 93c5179
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions runtime/src/main/java/io/quarkus/logging/sentry/SentryConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ public class SentryConfig {
@ConfigItem
public Optional<List<String>> inAppPackages;

/**
* Sentry differentiates stack frames that are directly related to your application (“in application”) from stack frames
* that come from other packages such as the standard library, frameworks, or other dependencies. The difference is visible
* in the Sentry web interface where only the “in application” frames are displayed by default.
*
* You can configure which package prefixes your application uses with this option.
*
* You can configure which package prefixes you want to exclude from logging.
*/
@ConfigItem
public Optional<List<String>> inAppExcludedPackages;

/**
* Environment
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public static SentryOptions toSentryOptions(SentryConfig sentryConfig) {
inAppPackages.forEach(options::addInAppInclude);
}
}

if (sentryConfig.inAppExcludedPackages.isPresent()) {
List<String> inAppExcludedPackages = sentryConfig.inAppExcludedPackages.get();
inAppExcludedPackages.forEach(options::addInAppExclude);
}

options.setDsn(sentryConfig.dsn.get());
sentryConfig.environment.ifPresent(options::setEnvironment);
sentryConfig.release.ifPresent(options::setRelease);
Expand Down

0 comments on commit 93c5179

Please sign in to comment.