Skip to content

chore(data-filter): cap backtrace frames - #580

Merged
neSpecc merged 1 commit into
masterfrom
data-filter-backtrace
Jul 29, 2026
Merged

chore(data-filter): cap backtrace frames#580
neSpecc merged 1 commit into
masterfrom
data-filter-backtrace

Conversation

@neSpecc

@neSpecc neSpecc commented Jul 29, 2026

Copy link
Copy Markdown
Member

Some projects sends bloated backtraces with 80-250 frames that took too much memory.

This PR improves Grouper's DataFilter logic to cap such backtrace frames (max 20 frames).

@neSpecc
neSpecc merged commit 5395b7d into master Jul 29, 2026
6 checks passed
@neSpecc
neSpecc deleted the data-filter-backtrace branch July 29, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces memory/storage impact from excessively large backtraces by moving backtrace/sourceCode trimming into Grouper’s DataFilter, capping frame count and source snippet size before the event is hashed/stored.

Changes:

  • Add DataFilter.trimBacktrace() to cap backtrace frames (20), sourceCode lines per frame (21), and trim long source lines.
  • Remove the old GrouperWorker.trimSourceCodeLines() preprocessing step from workers/grouper/src/index.ts.
  • Add tests covering backtrace frame/line caps and empty-backtrace normalization.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
workers/grouper/tests/data-filter.test.ts Adds test coverage for backtrace frame/line trimming and empty backtrace normalization.
workers/grouper/src/index.ts Removes the worker-level backtrace/sourceCode trimming step now handled by DataFilter.
workers/grouper/src/data-filter.ts Implements capped backtrace trimming and exports related constants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +27 to +30
/**
* Maximum length of a single source code line
*/
const MAX_CODE_LINE_LENGTH = 140;
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.

3 participants