Make Puma low-level handler send to all available Sentry instances
What does this MR do and why?
Previously the Puma low-level handler would only send to the legacy
Sentry client (Raven). This change updates the logic to use
Gitlab::ErrorTracking so that both new and legacy clients will
receive exceptions. In addition, the message will also be logged in exceptions_json.log.
Gitlab::ErrorTracking has been updated to support custom tags.
How to set up and validate locally
-
In the Rails console, enable the new Sentry integration:
Feature.enable(:configure_sentry_in_application_settings) Feature.enable(:enable_new_sentry_integration) -
In
/admin->Settings->Metrics and Reporting->Sentry, configure a Sentry DSN. I used the settings from https://new-sentry.gitlab.net/organizations/gitlab/projects/gitlab-test-instances/?project=31. Be sure checkEnable Sentry for Rails and Browser JavaScript. (I think that should be simplified to sayEnable Sentry). -
Check out this branch and
gdk restart rails. -
To trigger the Puma low-level handler, send a HTTP request to your GDK (to Puma, not NGINX) with a large header. For example, I used:
URL="http://localhost:3000"
large_header=""
for ((i=1; i<=50; i++)); do
large_header+="X-Custom-Header$i: $(openssl rand -base64 100)\r\n"
done
# Send the HTTP request with the large header using curl
curl -v -X GET -H "$large_header" "$URL"
- Now check
log/exceptions_json.logand the Sentry project for issues.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.