summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-29 18:06:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-29 18:06:24 +0000
commit8263f6ee3131cdea3c6041785c32771a6af0b24f (patch)
tree3dde0ed2466b10fa223eacbd51c78beb32009fbd /config
parenteac0da9a47f0c7b8b970833d7d5b96cfee057bf7 (diff)
downloadgitlab-ce-8263f6ee3131cdea3c6041785c32771a6af0b24f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r--config/initializers/0_marginalia.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/config/initializers/0_marginalia.rb b/config/initializers/0_marginalia.rb
new file mode 100644
index 00000000000..42d8f0bf5e1
--- /dev/null
+++ b/config/initializers/0_marginalia.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+require 'marginalia'
+
+::Marginalia::Comment.extend(::Gitlab::Marginalia::Comment)
+
+# Patch to include support for 'Marginalia.without_annotation' method.
+::Marginalia.singleton_class.prepend(Gitlab::Marginalia::InlineAnnotation)
+
+# Patch to modify 'Marginalia::ActiveRecordInstrumentation.annotate_sql' method with feature check.
+# Orignal Marginalia::ActiveRecordInstrumentation is included to ActiveRecord::ConnectionAdapters::PostgreSQLAdapter in the Marginalia Railtie.
+# 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]
+
+Gitlab::Marginalia.set_application_name
+
+Gitlab::Marginalia.enable_sidekiq_instrumentation