summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-29 03:07:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-29 03:07:51 +0000
commitd94ed2a46aad78435de66af05c84060ae78c8fc0 (patch)
tree19b057ae567e8bdd10289d290608362f466ca589 /config/initializers
parente56fd471503e00167ca96e7792f75a0d1f3b7891 (diff)
downloadgitlab-ce-d94ed2a46aad78435de66af05c84060ae78c8fc0.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/0_marginalia.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/config/initializers/0_marginalia.rb b/config/initializers/0_marginalia.rb
index f88a90854e3..a697f67dbf2 100644
--- a/config/initializers/0_marginalia.rb
+++ b/config/initializers/0_marginalia.rb
@@ -9,7 +9,13 @@ require 'marginalia'
# Refer: https://github.com/basecamp/marginalia/blob/v1.8.0/lib/marginalia/railtie.rb#L67
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(Gitlab::Marginalia::ActiveRecordInstrumentation)
-Marginalia::Comment.components = [:application, :controller, :action, :correlation_id, :jid, :job_class, :line]
+Marginalia::Comment.components = [:application, :controller, :action, :correlation_id, :jid, :job_class]
+
+# As mentioned in https://github.com/basecamp/marginalia/pull/93/files,
+# 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?
Gitlab::Marginalia.set_application_name