Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -15,7 +15,7 @@ sentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR
sentry.enable-backpressure-handling=true
sentry.enable-spotlight=true
sentry.enablePrettySerializationOutput=false
sentry.experimental.logs.enabled=true
sentry.logs.enabled=true
in-app-includes="io.sentry.samples"

# Uncomment and set to true to enable aot compatibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR
sentry.enable-backpressure-handling=true
sentry.enable-spotlight=true
sentry.enablePrettySerializationOutput=false
sentry.experimental.logs.enabled=true
sentry.logs.enabled=true
in-app-includes="io.sentry.samples"

# Uncomment and set to true to enable aot compatibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sentry.enable-backpressure-handling=true
sentry.enable-spotlight=true
sentry.enablePrettySerializationOutput=false
in-app-includes="io.sentry.samples"
sentry.experimental.logs.enabled=true
sentry.logs.enabled=true

# Uncomment and set to true to enable aot compatibility
# This flag disables all AOP related features (i.e. @SentryTransaction, @SentrySpan)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentry.debug=true
sentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR
sentry.enable-backpressure-handling=true
sentry.enable-spotlight=true
sentry.experimental.logs.enabled=true
sentry.logs.enabled=true
in-app-includes="io.sentry.samples"

# Database configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentry.debug=true
sentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR
sentry.enable-backpressure-handling=true
sentry.enable-spotlight=true
sentry.experimental.logs.enabled=true
sentry.logs.enabled=true
in-app-includes="io.sentry.samples"

# Database configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ sentry.logging.minimum-breadcrumb-level=debug
sentry.reactive.thread-local-accessor-enabled=true
sentry.traces-sample-rate=1.0
sentry.enable-backpressure-handling=true
sentry.experimental.logs.enabled=true
sentry.logs.enabled=true
sentry.enable-spotlight=true
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ spring.graphql.graphiql.enabled=true
spring.graphql.websocket.path=/graphql
spring.graphql.schema.printer.enabled=true
sentry.enable-backpressure-handling=true
sentry.experimental.logs.enabled=true
sentry.logs.enabled=true
sentry.enable-spotlight=true
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentry.debug=true
sentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR
sentry.enable-backpressure-handling=true
sentry.enable-spotlight=true
sentry.experimental.logs.enabled=true
sentry.logs.enabled=true
in-app-includes="io.sentry.samples"

# Database configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class SentryAutoConfigurationTest {
"sentry.cron.default-timezone=America/New_York",
"sentry.cron.default-failure-issue-threshold=40",
"sentry.cron.default-recovery-threshold=50",
"sentry.experimental.logs.enabled=true"
"sentry.logs.enabled=true"
).run {
val options = it.getBean(SentryProperties::class.java)
assertThat(options.readTimeoutMillis).isEqualTo(10)
Expand Down Expand Up @@ -233,7 +233,7 @@ class SentryAutoConfigurationTest {
assertThat(options.cron!!.defaultTimezone).isEqualTo("America/New_York")
assertThat(options.cron!!.defaultFailureIssueThreshold).isEqualTo(40L)
assertThat(options.cron!!.defaultRecoveryThreshold).isEqualTo(50L)
assertThat(options.experimental.logs.isEnabled).isEqualTo(true)
assertThat(options.logs.isEnabled).isEqualTo(true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class SentryAutoConfigurationTest {
"sentry.cron.default-timezone=America/New_York",
"sentry.cron.default-failure-issue-threshold=40",
"sentry.cron.default-recovery-threshold=50",
"sentry.experimental.logs.enabled=true"
"sentry.logs.enabled=true"
).run {
val options = it.getBean(SentryProperties::class.java)
assertThat(options.readTimeoutMillis).isEqualTo(10)
Expand Down Expand Up @@ -232,7 +232,7 @@ class SentryAutoConfigurationTest {
assertThat(options.cron!!.defaultTimezone).isEqualTo("America/New_York")
assertThat(options.cron!!.defaultFailureIssueThreshold).isEqualTo(40L)
assertThat(options.cron!!.defaultRecoveryThreshold).isEqualTo(50L)
assertThat(options.experimental.logs.isEnabled).isEqualTo(true)
assertThat(options.logs.isEnabled).isEqualTo(true)
}
}

Expand Down
4 changes: 2 additions & 2 deletions sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,6 @@ public abstract interface class io/sentry/EventProcessor {

public final class io/sentry/ExperimentalOptions {
public fun <init> (ZLio/sentry/protocol/SdkVersion;)V
public fun getLogs ()Lio/sentry/SentryOptions$Logs;
public fun setLogs (Lio/sentry/SentryOptions$Logs;)V
}

public final class io/sentry/ExternalOptions {
Expand Down Expand Up @@ -3223,6 +3221,7 @@ public class io/sentry/SentryOptions {
public fun getIntegrations ()Ljava/util/List;
public fun getInternalTracesSampler ()Lio/sentry/TracesSampler;
public fun getLogger ()Lio/sentry/ILogger;
public fun getLogs ()Lio/sentry/SentryOptions$Logs;
public fun getMaxAttachmentSize ()J
public fun getMaxBreadcrumbs ()I
public fun getMaxCacheItems ()I
Expand Down Expand Up @@ -3362,6 +3361,7 @@ public class io/sentry/SentryOptions {
public fun setInitPriority (Lio/sentry/InitPriority;)V
public fun setInstrumenter (Lio/sentry/Instrumenter;)V
public fun setLogger (Lio/sentry/ILogger;)V
public fun setLogs (Lio/sentry/SentryOptions$Logs;)V
public fun setMaxAttachmentSize (J)V
public fun setMaxBreadcrumbs (I)V
public fun setMaxCacheItems (I)V
Expand Down
13 changes: 0 additions & 13 deletions sentry/src/main/java/io/sentry/ExperimentalOptions.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.sentry;

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

/**
Expand All @@ -12,17 +10,6 @@
* <p>Beware that experimental options can change at any time.
*/
public final class ExperimentalOptions {
private @NotNull SentryOptions.Logs logs = new SentryOptions.Logs();

public ExperimentalOptions(final boolean empty, final @Nullable SdkVersion sdkVersion) {}

@ApiStatus.Experimental
public @NotNull SentryOptions.Logs getLogs() {
return logs;
}

@ApiStatus.Experimental
public void setLogs(@NotNull SentryOptions.Logs logs) {
this.logs = logs;
}
}
2 changes: 1 addition & 1 deletion sentry/src/main/java/io/sentry/ExternalOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public final class ExternalOptions {
options.setCaptureOpenTelemetryEvents(
propertiesProvider.getBooleanProperty("capture-open-telemetry-events"));

options.setEnableLogs(propertiesProvider.getBooleanProperty("experimental.logs.enabled"));
options.setEnableLogs(propertiesProvider.getBooleanProperty("logs.enabled"));

for (final String ignoredExceptionType :
propertiesProvider.getList("ignored-exceptions-for-type")) {
Expand Down
4 changes: 2 additions & 2 deletions sentry/src/main/java/io/sentry/SentryClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public SentryClient(final @NotNull SentryOptions options) {

final RequestDetailsResolver requestDetailsResolver = new RequestDetailsResolver(options);
transport = transportFactory.create(options, requestDetailsResolver.resolve());
if (options.getExperimental().getLogs().isEnabled()) {
if (options.getLogs().isEnabled()) {
loggerBatchProcessor = new LoggerBatchProcessor(options, this);
} else {
loggerBatchProcessor = NoOpLoggerBatchProcessor.getInstance();
Expand Down Expand Up @@ -1456,7 +1456,7 @@ private void sortBreadcrumbsByDate(
private @Nullable SentryLogEvent executeBeforeSendLog(
@NotNull SentryLogEvent event, final @NotNull Hint hint) {
final SentryOptions.Logs.BeforeSendLogCallback beforeSendLog =
options.getExperimental().getLogs().getBeforeSend();
options.getLogs().getBeforeSend();
if (beforeSendLog != null) {
try {
event = beforeSendLog.execute(event, hint);
Expand Down
14 changes: 13 additions & 1 deletion sentry/src/main/java/io/sentry/SentryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ public class SentryOptions {
*/
private boolean startProfilerOnAppStart = false;

private @NotNull SentryOptions.Logs logs = new SentryOptions.Logs();

private @NotNull ISocketTagger socketTagger = NoOpSocketTagger.getInstance();

/**
Expand Down Expand Up @@ -3203,7 +3205,7 @@ public void merge(final @NotNull ExternalOptions options) {
}

if (options.isEnableLogs() != null) {
getExperimental().getLogs().setEnabled(options.isEnableLogs());
getLogs().setEnabled(options.isEnableLogs());
}
}

Expand Down Expand Up @@ -3231,6 +3233,16 @@ public void setSpanFactory(final @NotNull ISpanFactory spanFactory) {
this.spanFactory = spanFactory;
}

@ApiStatus.Experimental
public @NotNull SentryOptions.Logs getLogs() {
return logs;
}

@ApiStatus.Experimental
public void setLogs(@NotNull SentryOptions.Logs logs) {
this.logs = logs;
}

public static final class Proxy {
private @Nullable String host;
private @Nullable String port;
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/main/java/io/sentry/logger/LoggerApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void captureLog(
return;
}

if (!options.getExperimental().getLogs().isEnabled()) {
if (!options.getLogs().isEnabled()) {
options
.getLogger()
.log(SentryLevel.WARNING, "Sentry Log is disabled and this 'logger' call is a no-op.");
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/java/io/sentry/ExternalOptionsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class ExternalOptionsTest {

@Test
fun `creates options with enableLogs set to true`() {
withPropertiesFile("experimental.logs.enabled=true") { options ->
withPropertiesFile("logs.enabled=true") { options ->
assertTrue(options.isEnableLogs == true)
}
}
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/java/io/sentry/SentryOptionsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class SentryOptionsTest {
assertTrue(options.isEnableSpotlight)
assertEquals("http://local.sentry.io:1234", options.spotlightConnectionUrl)
assertTrue(options.isGlobalHubMode!!)
assertTrue(options.experimental.logs.isEnabled!!)
assertTrue(options.logs.isEnabled!!)
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion test/system-test-spring-server-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ fi

echo "$JAVA_AGENT_STRING"

SENTRY_DSN="http://502f25099c204a2fbf4cb16edc5975d1@localhost:8000/0" SENTRY_AUTO_INIT=${JAVA_AGENT_AUTO_INIT} SENTRY_TRACES_SAMPLE_RATE=1.0 OTEL_TRACES_EXPORTER=none OTEL_METRICS_EXPORTER=none OTEL_LOGS_EXPORTER=none SENTRY_EXPERIMENTAL_LOGS_ENABLED=true java ${JAVA_AGENT_STRING} -jar sentry-samples/${SAMPLE_MODULE}/build/libs/${SAMPLE_MODULE}-0.0.1-SNAPSHOT.jar > spring-server.txt 2>&1 &
SENTRY_DSN="http://502f25099c204a2fbf4cb16edc5975d1@localhost:8000/0" SENTRY_AUTO_INIT=${JAVA_AGENT_AUTO_INIT} SENTRY_TRACES_SAMPLE_RATE=1.0 OTEL_TRACES_EXPORTER=none OTEL_METRICS_EXPORTER=none OTEL_LOGS_EXPORTER=none SENTRY_LOGS_ENABLED=true java ${JAVA_AGENT_STRING} -jar sentry-samples/${SAMPLE_MODULE}/build/libs/${SAMPLE_MODULE}-0.0.1-SNAPSHOT.jar > spring-server.txt 2>&1 &
echo $! > spring-server.pid
Loading