diff options
author | Stan Hu <stanhu@gmail.com> | 2019-03-19 18:44:35 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-03-19 18:44:35 +0000 |
commit | 74ebeebbcdbe5a996610fa02711f0563b4a774fa (patch) | |
tree | b0c54bfdd5f3c9ebc075b9fb880b3afe33ef6c5b /config | |
parent | 934253c9475a2f2d8a562bcc6bbb8a5f52efa713 (diff) | |
parent | 58643cd5325f731799686daca8e1d9806851c320 (diff) | |
download | gitlab-ce-74ebeebbcdbe5a996610fa02711f0563b4a774fa.tar.gz |
Merge branch 'send-columns-to-sentry-on-missingattributeerror' into 'master'
Send schema cache to Sentry on MissingAttributeError
See merge request gitlab-org/gitlab-ce!26331
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/sentry.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index abc91c3ae51..680cfa6f0ed 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -20,6 +20,21 @@ def configure_sentry # Sanitize authentication headers config.sanitize_http_headers = %w[Authorization Private-Token] config.tags = { program: Gitlab.process_name } + # Debugging for https://gitlab.com/gitlab-org/gitlab-ce/issues/57727 + config.before_send = lambda do |event, hint| + if ActiveModel::MissingAttributeError === hint[:exception] + columns_hash = ActiveRecord::Base + .connection + .schema_cache + .instance_variable_get(:@columns_hash) + .map { |k, v| [k, v.map(&:first)] } + .to_h + + event.extra.merge!(columns_hash) + end + + event + end end end end |