Commit 0f232822 authored by Stan Hu's avatar Stan Hu

Improve Marginalia line filtering

In development mode, Marginalia comments include the line that
originated the request in the SQL development log. However, the default
filter fails to ignore the load balancing code, so the comment would
usually attribute the call to the connection proxy.

We now filter out some lines to help narrow in the real caller of the
SQL query.
parent 328e1a6d
......@@ -19,7 +19,10 @@ Marginalia::Comment.components = [:application, :correlation_id, :jid, :endpoint
# adding :line has some overhead because a regexp on the backtrace has
# to be run on every SQL query. Only enable this in development because
# we've seen it slow things down.
Marginalia::Comment.components << :line if Rails.env.development?
if Rails.env.development?
Marginalia::Comment.components << :line
Marginalia::Comment.lines_to_ignore = Regexp.union(Gitlab::BacktraceCleaner::IGNORE_BACKTRACES + %w(lib/ruby/gems/ lib/gem_extensions/ lib/ruby/))
end
Gitlab::Marginalia.set_application_name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment