-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(feedback): enforce a max message size from all sources #79326
Conversation
tags={ | ||
"is_spam": is_message_spam, | ||
"pow2_size_bucket": 2 ** math.ceil(math.log2(len(feedback_message))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limits the granularity of this tag. I'd rather do this for viewing in datadog, instead of logging each msg size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant we just use a distribution metric type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'll add a log too so we can see the org/project id.
This PR has a migration; here is the generated SQL for --
-- Alter field comments on userreport
--
-- (no-op) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration lgtm
… in one file + rename/comment
register( | ||
"feedback.message.max-size", | ||
type=Int, | ||
default=4096, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need an option if the max-length is also in the schema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The max length schema is for legacy feedbacks only, aka user reports. User reports are shimmed to feedback issues, but not vice versa. IMO it makes sense to have a separate option for new feedback.
In the long-term it makes more sense to enforce a maximum on the upstream envelopes, but I need more time to look into that. This just plugs all holes for now, resolving that sentry issue. We can gather some metrics and have a flexible limit for now, using the option. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the long-term it makes more sense to enforce a maximum on the upstream envelopes, but I need more time to look into that. This just plugs all holes for now, resolving that sentry issue.
That makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some feedback: this PR could have been broken up for easier reviewing, but overall looks good. 👍🏼
Got it, thanks for lmk! |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #79326 +/- ##
==========================================
+ Coverage 78.33% 78.35% +0.01%
==========================================
Files 7125 7123 -2
Lines 314677 314900 +223
Branches 51431 51464 +33
==========================================
+ Hits 246515 246739 +224
+ Misses 61698 61690 -8
- Partials 6464 6471 +7 |
Closes #76298 Closes [SENTRY-3B86](https://sentry.sentry.io/issues/5552524761/) Decided on a limit of 4096, generously below the LLM request, postgres, and kafka size limits described in the ticket. Messages that are too large will be truncated (or rejected, for crash report modal) and skip spam detection, auto-marking as spam. Includes a small refactor of `create_feedback.py`, moving stuff around and commenting a bit. ~~Renamed `auto_ignore_spam_feedback` to `set_feedback_ignored`.~~
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Closes #76298
Closes SENTRY-3B86
Decided on a limit of 4096, generously below the LLM request, postgres, and kafka size limits described in the ticket. Messages that are too large will be truncated (or rejected, for crash report modal) and skip spam detection, auto-marking as spam.
Includes a small refactor of
create_feedback.py
, moving stuff around and commenting a bit.Renamedauto_ignore_spam_feedback
toset_feedback_ignored
.