Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit backtrace args size (Fixes #122) #134

Merged
merged 4 commits into from
Feb 24, 2021
Merged

Limit backtrace args size (Fixes #122) #134

merged 4 commits into from
Feb 24, 2021

Conversation

shalvah
Copy link
Contributor

@shalvah shalvah commented Feb 24, 2021

Status

READY

Description

This PR introduces an ArgumentValueNormalizer class, whose job is to "normalise" arguments before they are serialised and sent to Honeybadger.

The ArgumentValueNormalizer will normalize each kind of value properly. For instance:

  • For objects, it will replace them with the class name (or whatever we switch to after Better representation of objects in backtrace args #133 ).
  • For arrays, it will normalize each item up to a maximum number of keys and maximum nesting depth in order to limit the backtrace size. Here's what an array truncated due to excessive nesting looks like:

image

Currently the defaults are 50 keys per array and a max depth of 10. @stympy let me know if this makes sense.

@shalvah shalvah requested review from sixlive and stympy February 24, 2021 04:17
Copy link
Member

@stympy stympy left a comment

Choose a reason for hiding this comment

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

👍

@shalvah shalvah merged commit 27a47df into master Feb 24, 2021
@shalvah shalvah deleted the limit-args-size branch February 24, 2021 16:59
@shalvah
Copy link
Contributor Author

shalvah commented Feb 24, 2021

image

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