From 24a87993085b98831623b7931272b017cf35c2cb Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Fri, 19 Dec 2025 11:57:20 +0100 Subject: [PATCH] feat(telemetry-buffer): Add envelope size limits Also update the envelpe size limits according to current Relay config. --- develop-docs/sdk/data-model/envelopes.mdx | 23 ++++++++++--------- .../telemetry/telemetry-processor/index.mdx | 4 ++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/develop-docs/sdk/data-model/envelopes.mdx b/develop-docs/sdk/data-model/envelopes.mdx index cc7dad913775e8..c31db923ce8e04 100644 --- a/develop-docs/sdk/data-model/envelopes.mdx +++ b/develop-docs/sdk/data-model/envelopes.mdx @@ -339,17 +339,18 @@ SDKs should not rely on Envelope header authentication to retain backward compat ### Size Limits Event ingestion imposes limits on the size and number of Items in Envelopes. -These limits are subject to future change and defined currently as: - -- *40MB* for a compressed envelope request -- *200MB* for a full envelope after decompression -- *200MB* for all attachments combined -- *200MB* for each attachment item -- *1MB* for event (errors and transactions), span, log, and metric (statsd, buckets, meta) items. -- *100KB* for monitor check-in items -- *50MB* for profile items -- *10MB* for compressed replay item -- *100MB* for replay item after decompression +These limits are subject to future change and defined currently as (see [Relay config source](https://github.com/getsentry/relay/blob/master/relay-config/src/config.rs)): + +- *200 MiB* for a full envelope after decompression +- *200 MiB* for all attachments combined +- *200 MiB* for each attachment item +- *1 MiB* for event (errors and transactions), span, log, and metric (statsd, buckets, meta) envelope items. +- *2 KiB* average per metric within an envelope. Relay discards the entire envelope if the average of all metrics within it exceeds 2 KiB. +- *100 KiB* for monitor check-in items +- *4 KiB* for client report items +- *50 MiB* for profile items +- *10 MiB* for compressed replay items +- *100 MiB* for replay items after decompression - *100 sessions* per envelope - *100 pre-aggregated session buckets* per each `"sessions"` item diff --git a/develop-docs/sdk/telemetry/telemetry-processor/index.mdx b/develop-docs/sdk/telemetry/telemetry-processor/index.mdx index 554086f7a220b3..1decb1734960e0 100644 --- a/develop-docs/sdk/telemetry/telemetry-processor/index.mdx +++ b/develop-docs/sdk/telemetry/telemetry-processor/index.mdx @@ -47,6 +47,10 @@ The TelemetryBuffer **MUST** forward all data in memory to the transport to avoi 2. When the user calls `SentrySDK.close()`, the TelemetryBuffer **MUST** forward all data in memory to the transport. SDKs **SHOULD** keep their existing closing behavior. 3. When the application shuts down gracefully, the TelemetryBuffer **SHOULD** forward all data in memory to the transport. The transport **SHOULD** keep its existing behavior, which usually stores the data to disk as an envelope. It is not required to call transport `flush`. +## Envelope Size Limits + +The different telemetry buffers **MUST** be compatible with the [envelope item size limits](/sdk/data-model/envelopes/#size-limits) imposed by Relay. + ## FAQ