getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.56k stars 4.12k forks source link

UF Backend: Limit feedback message size #76298

Open aliu39 opened 1 month ago

aliu39 commented 1 month ago

We discovered in SENTRY-3B86 feedback msgs above a certain size causes errors in the backend. This issue is in spam detection, but looking at a sample trace: this also causes errors writing to Kafka and Postgres (post process job).

Brainstorm: A good start for what the limit should be is text-bison's max input token limit of 8192. (AI model we're using for spam) https://ai.google.dev/palm_docs/palm#model-metadata. We need to check the size limits for kafka (think it's ~10kb) and postgres too.

We'd prefer to set limits upstream. There are multiple creation sources (see https://develop.sentry.dev/application/feedback-architecture/), so let's define an option for this msg size limit.

The places to truncate msgs are:

getsantry[bot] commented 1 month ago

Routing to @getsentry/product-owners-user-feedback for triage ⏲️

billyvg commented 1 month ago

We should make sure that front end displays a reasonable error msg as well

aliu39 commented 2 weeks ago

We can also set max_length for the comments field of userreport.py But not sure how this would affect the current data, if we need a migration, etc