Reduce memory consumption when an API exception goes to Sentry
When Sentry gets Rack context, it can grab information that is very large (like Grape routing information) from the Rack environment. It can waste a lot of time and memory processing that information, only to then ... not send it to Sentry as it's not a standard key. https://github.com/getsentry/sentry-ruby/pull/1197 describes this perfectly, but as we're not on the latest version, https://github.com/getsentry/sentry-ruby/pull/1198 is the PR that we're pulling in to fix this issue. To test this locally: 1. Create a project. 2. Move or delete its on-disk repo. 3. Configure Sentry. 4. Run `curl http://$host/api/v4/projects/$id/repository/branches/main`. 5. Check the `mem_bytes` field in `api_json.log`. This change takes several hundred megabytes from that value in my local environment. Changelog: performance
Showing
... | ... | @@ -306,7 +306,7 @@ gem 'gitlab-license', '~> 1.5' |
gem 'rack-attack', '~> 6.3.0' | ||
# Sentry integration | ||
gem 'sentry-raven', '~> 3.0' | ||
gem 'sentry-raven', '~> 3.1' | ||
# PostgreSQL query parsing | ||
gem 'pg_query', '~> 2.0.3' | ||
... | ... |
Please register or sign in to comment