Skip to content

feat(eap): Trim spans with new trimming processor#5616

Merged
loewenheim merged 22 commits intomasterfrom
sebastian/trim-eap-items
Feb 9, 2026
Merged

feat(eap): Trim spans with new trimming processor#5616
loewenheim merged 22 commits intomasterfrom
sebastian/trim-eap-items

Conversation

@loewenheim
Copy link
Contributor

This puts the new trimming processor into practice by enabling it for spans. It also introduces some necessary configuration:

  • A new max_removed_attribute_key_bytes (default 10KiB) that controls up to which limit Relay will store invalid/removed attribute keys.
  • A trimming section in the project config which (for now) allows configuring the maximum bytes size above which spans should be trimmed. If this is not set, spans will not be trimmed.
  • Field attributes on spans that exclude everything but attributes from trimming and size calculations.

ref: INGEST-732.

@loewenheim loewenheim requested a review from a team as a code owner February 5, 2026 12:35
@linear
Copy link

linear bot commented Feb 5, 2026

@loewenheim loewenheim force-pushed the sebastian/trim-eap-items branch from 71dd15b to b7f3288 Compare February 6, 2026 14:17
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

return Ok(());
}

// This counts the lengths of all attribute keys regardless of whether
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object trimming drops last remarked key via split_off

Medium Severity

The process_object split logic sets i = key.as_str() before the match and never advances it afterward, so split_off(&i) removes the last key that received WithRemark. In contrast, process_array and process_attributes both increment i after the match, correctly preserving remarked entries. When all remaining keys fit within removed_key_byte_budget, the final remarked key is silently dropped. This code was previously gated behind #[allow(unused)] and is now activated for span processing.

Additional Locations (1)

Fix in Cursor Fix in Web

@loewenheim loewenheim enabled auto-merge February 9, 2026 11:18
@loewenheim loewenheim added this pull request to the merge queue Feb 9, 2026
Merged via the queue into master with commit 7b0ce4f Feb 9, 2026
28 checks passed
@loewenheim loewenheim deleted the sebastian/trim-eap-items branch February 9, 2026 11:56
loewenheim added a commit to getsentry/sentry that referenced this pull request Feb 11, 2026
This adds the trimming configuration implemented in Relay in
getsentry/relay#5616 to the project config. The
implementation in `sentry` is trivial; the actual values are going to be
provided in `getsentry` in a subsequent PR.
loewenheim added a commit to getsentry/sentry that referenced this pull request Feb 16, 2026
This adds the trimming configuration implemented in Relay in
getsentry/relay#5616 to the project config. The
implementation in `sentry` is trivial; the actual values are going to be
provided in `getsentry` in a subsequent PR.

Closes INGEST-747.

---------

Co-authored-by: Simon Hellmayr <shellmayr@users.noreply.github.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants