Skip to content

Commit

Permalink
Fix deprecations and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Feb 20, 2025
1 parent 19edcef commit ef771b7
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 56 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;
import io.sentry.HubAdapter;
import io.sentry.ScopesAdapter;
import io.sentry.Sentry;
import io.sentry.SentryOptions;

Expand All @@ -24,7 +24,7 @@ public class SentryLoggerCustomTest {
@Test
public void sentryLoggerCustomTest() {
final Handler sentryHandler = getSentryHandler();
final SentryOptions options = HubAdapter.getInstance().getOptions();
final SentryOptions options = ScopesAdapter.getInstance().getOptions();
assertThat(sentryHandler).isNotNull();
assertThat(sentryHandler.getLevel()).isEqualTo(org.jboss.logmanager.Level.TRACE);
assertThat(options.getInAppIncludes()).contains("io.quarkus.logging.sentry").contains("org.test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;
import io.sentry.HubAdapter;
import io.sentry.ScopesAdapter;
import io.sentry.Sentry;
import io.sentry.SentryOptions;

Expand All @@ -23,7 +23,7 @@ public class SentryLoggerEnvironmentOptionTests {
@Test
public void sentryLoggerEnvironmentOptionTest() {
final Handler sentryHandler = getSentryHandler();
final SentryOptions options = HubAdapter.getInstance().getOptions();
final SentryOptions options = ScopesAdapter.getInstance().getOptions();
assertThat(sentryHandler).isNotNull();
assertThat(options.getEnvironment()).isEqualTo("test-environment");
assertThat(Sentry.isEnabled()).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;
import io.sentry.HubAdapter;
import io.sentry.ScopesAdapter;
import io.sentry.Sentry;
import io.sentry.SentryOptions;

Expand All @@ -23,7 +23,7 @@ public class SentryLoggerReleaseOptionTests {
@Test
public void sentryLoggerEnvironmentOptionTest() {
final Handler sentryHandler = getSentryHandler();
final SentryOptions options = HubAdapter.getInstance().getOptions();
final SentryOptions options = ScopesAdapter.getInstance().getOptions();
assertThat(sentryHandler).isNotNull();
assertThat(options.getRelease()).isEqualTo("releaseABC");
assertThat(Sentry.isEnabled()).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.quarkus.bootstrap.logging.InitialConfigurator;
import io.quarkus.bootstrap.logging.QuarkusDelayedHandler;
import io.quarkus.test.QuarkusUnitTest;
import io.sentry.HubAdapter;
import io.sentry.ScopesAdapter;
import io.sentry.Sentry;
import io.sentry.SentryOptions;
import io.sentry.jul.SentryHandler;
Expand All @@ -29,7 +29,7 @@ public class SentryLoggerTest {
@Test
public void sentryLoggerDefaultTest() {
final Handler sentryHandler = getSentryHandler();
final SentryOptions options = HubAdapter.getInstance().getOptions();
final SentryOptions options = ScopesAdapter.getInstance().getOptions();
assertThat(sentryHandler).isNotNull();
assertThat(options.getInAppIncludes()).isEmpty();
assertThat(options.getDsn()).isEqualTo("https://123@default.com/22222");
Expand All @@ -45,10 +45,9 @@ public static Handler getSentryHandler() {
assertThat(Logger.getLogger("").getHandlers()).contains(delayedHandler);
assertThat(delayedHandler.getLevel()).isEqualTo(Level.ALL);

Handler handler = Arrays.stream(delayedHandler.getHandlers())
return Arrays.stream(delayedHandler.getHandlers())
.filter(h -> SentryHandler.class.getName().equals(h.getClass().getName()))
.findFirst().orElse(null);
return handler;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;
import io.sentry.HubAdapter;
import io.sentry.ScopesAdapter;
import io.sentry.SentryOptions;

public class SentryLoggerTracesSampleRateOptionTests {
Expand All @@ -22,7 +22,7 @@ public class SentryLoggerTracesSampleRateOptionTests {
@Test
public void sentryLoggerEnvironmentOptionTest() {
final Handler sentryHandler = getSentryHandler();
final SentryOptions options = HubAdapter.getInstance().getOptions();
final SentryOptions options = ScopesAdapter.getInstance().getOptions();
assertThat(sentryHandler).isNotNull();
assertThat(options.getTracesSampleRate()).isOne();
}
Expand Down
69 changes: 57 additions & 12 deletions docs/modules/ROOT/pages/includes/quarkus-logging-sentry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-dsn]] [.property-path]##link:#qua

[.description]
--
Sentry DSN The DSN is the first and most important thing to configure because it tells the SDK where to send events. You can find your project’s DSN in the “Client Keys” section of your “Project Settings” in Sentry.
Sentry DSN

The DSN is the first and most important thing to configure because it tells the SDK where to send events. You can find your project’s DSN in the “Client Keys” section of your “Project Settings” in Sentry.


ifdef::add-copy-button-to-env-var[]
Expand Down Expand Up @@ -63,7 +65,9 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-minimum-event-level]] [.property-

[.description]
--
The minimum event level. Every log statement that is greater than minimum event level is turned into Sentry event.
The minimum event level.

Every log statement that is greater than minimum event level is turned into Sentry event.


ifdef::add-copy-button-to-env-var[]
Expand All @@ -80,7 +84,9 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-minimum-breadcrumb-level]] [.prop

[.description]
--
The minimum breadcrumb level. Every log statement that is greater than minimum breadcrumb level is added to Sentry scope as a breadcrumb, which can be later attached to SentryEvent if one is triggered.
The minimum breadcrumb level.

Every log statement that is greater than minimum breadcrumb level is added to Sentry scope as a breadcrumb, which can be later attached to SentryEvent if one is triggered.


ifdef::add-copy-button-to-env-var[]
Expand All @@ -97,7 +103,11 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-in-app-packages]] [.property-path

[.description]
--
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. This option is highly recommended as it affects stacktrace grouping and display on Sentry. See documentation: https://quarkus.io/guides/logging-sentry++#++in-app-packages
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.

This option is highly recommended as it affects stacktrace grouping and display on Sentry. See documentation: link:https://quarkus.io/guides/logging-sentry#in-app-packages[...]


ifdef::add-copy-button-to-env-var[]
Expand All @@ -114,7 +124,11 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-in-app-excluded-packages]] [.prop

[.description]
--
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.
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.


ifdef::add-copy-button-to-env-var[]
Expand Down Expand Up @@ -144,11 +158,32 @@ endif::add-copy-button-to-env-var[]
|list of string
|

a| [[quarkus-logging-sentry_quarkus-log-sentry-ignored-errors]] [.property-path]##link:#quarkus-logging-sentry_quarkus-log-sentry-ignored-errors[`quarkus.log.sentry.ignored-errors`]##

[.description]
--
You can use this option to filter out errors whose message matches a certain pattern before sending to Sentry.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_LOG_SENTRY_IGNORED_ERRORS+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_LOG_SENTRY_IGNORED_ERRORS+++`
endif::add-copy-button-to-env-var[]
--
|list of string
|

a| [[quarkus-logging-sentry_quarkus-log-sentry-environment]] [.property-path]##link:#quarkus-logging-sentry_quarkus-log-sentry-environment[`quarkus.log.sentry.environment`]##

[.description]
--
Environment With Sentry you can easily filter issues, releases, and user feedback by environment. The environment filter on sentry affects all issue-related metrics like count of users affected, times series graphs, and event count. By setting the environment option, an environment tag will be added to each new issue sent to Sentry. There are a few restrictions: -> the environment name cannot contain newlines or spaces, cannot be the string “None” or exceed 64 characters.
Environment

With Sentry, you can easily filter issues, releases, and user feedback by environment. The environment filter on sentry affects all issue-related metrics like count of users affected, times series graphs, and event count. By setting the environment option, an environment tag will be added to each new issue sent to Sentry.

There are a few restrictions: -> the environment name cannot contain newlines or spaces, cannot be the string “None” or exceed 64 characters.


ifdef::add-copy-button-to-env-var[]
Expand All @@ -165,7 +200,9 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-release]] [.property-path]##link:

[.description]
--
Release A release is a version of your code that is deployed to an environment. When you give Sentry information about your releases, you unlock a number of new features: - Determine the issues and regressions introduced in a new release - Predict which commit caused an issue and who is likely responsible - Resolve issues by including the issue number in your commit message - Receive email notifications when your code gets deployed
Release

A release is a version of your code that is deployed to an environment. When you give Sentry information about your releases, you unlock a number of new features: - Determine the issues and regressions introduced in a new release - Predict which commit caused an issue and who is likely responsible - Resolve issues by including the issue number in your commit message - Receive email notifications when your code gets deployed


ifdef::add-copy-button-to-env-var[]
Expand All @@ -182,7 +219,9 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-server-name]] [.property-path]##l

[.description]
--
Server name Sets the server name that will be sent with each event.
Server name

Sets the server name that will be sent with each event.


ifdef::add-copy-button-to-env-var[]
Expand All @@ -199,7 +238,9 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-debug]] [.property-path]##link:#q

[.description]
--
Debug Enables Sentry debug mode.
Debug

Enables Sentry debug mode.


ifdef::add-copy-button-to-env-var[]
Expand All @@ -216,7 +257,7 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-traces-sample-rate]] [.property-p

[.description]
--
This should be a float/double between 0.0 and 1.0 (inclusive) and represents the percentage chance that any given transaction will be sent to Sentry. So, barring outside influence, 0.0 is a 0% chance (none will be sent) and 1.0 is a 100% chance (all will be sent). This rate applies equally to all transactions.
This should be a float/double between 0.0 and 1.0 (inclusive) and represents the percentage chance that any given transaction will be sent to Sentry. So, barring outside influence, 0.0 is a 0% chance (none will be sent) and 1.0 is a 100% chance (all will be sent). This rate applies equally to all transactions. Can be anything between 0.0 and 1.0 or null (default), to disable it.


ifdef::add-copy-button-to-env-var[]
Expand All @@ -233,7 +274,9 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-context-tags]] [.property-path]##

[.description]
--
Context Tags Specifics the MDC tags that are used as Sentry tags
Context Tags

Specifics the MDC tags that are used as Sentry tags


ifdef::add-copy-button-to-env-var[]
Expand All @@ -250,7 +293,9 @@ a| [[quarkus-logging-sentry_quarkus-log-sentry-tags-tags]] [.property-path]##lin

[.description]
--
Static tags Static tags that are sent to Sentry with every event.
Static tags

Static tags that are sent to Sentry with every event.


ifdef::add-copy-button-to-env-var[]
Expand Down
Loading

0 comments on commit ef771b7

Please sign in to comment.