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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Improvements

- Expose `MAX_EVENT_SIZE_BYTES` constant in SentryOptions ([#4962](https://github.com/getsentry/sentry-java/pull/4962))
- Discard envelopes on `4xx` and `5xx` response ([#4950](https://github.com/getsentry/sentry-java/pull/4950))
- This aims to not overwhelm Sentry after an outage or load shedding (including HTTP 429) where too many events are sent at once

Expand Down
1 change: 1 addition & 0 deletions sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -3341,6 +3341,7 @@ public final class io/sentry/SentryOpenTelemetryMode : java/lang/Enum {

public class io/sentry/SentryOptions {
public static final field DEFAULT_PROPAGATION_TARGETS Ljava/lang/String;
public static final field MAX_EVENT_SIZE_BYTES J
protected final field lock Lio/sentry/util/AutoClosableReentrantLock;
public fun <init> ()V
public fun addBundleId (Ljava/lang/String;)V
Expand Down
3 changes: 3 additions & 0 deletions sentry/src/main/java/io/sentry/SentryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class SentryOptions {

@ApiStatus.Internal public static final @NotNull String DEFAULT_PROPAGATION_TARGETS = ".*";

/** Maximum size of an event in bytes. Events exceeding this limit will be reduced. */
public static final long MAX_EVENT_SIZE_BYTES = 1024 * 1024;

/** Default Log level if not specified Default is DEBUG */
static final SentryLevel DEFAULT_DIAGNOSTIC_LEVEL = SentryLevel.DEBUG;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.sentry.util;

import static io.sentry.SentryOptions.MAX_EVENT_SIZE_BYTES;

import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.SentryEvent;
Expand All @@ -22,7 +24,6 @@
@ApiStatus.Internal
public final class EventSizeLimitingUtils {

private static final long MAX_EVENT_SIZE_BYTES = 1024 * 1024;
private static final int MAX_FRAMES_PER_STACK = 500;
private static final int FRAMES_PER_SIDE = MAX_FRAMES_PER_STACK / 2;

Expand Down
Loading