summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAndrew Newdigate <andrew@gitlab.com>2019-01-23 16:53:23 +0200
committerAndrew Newdigate <andrew@gitlab.com>2019-01-24 13:11:09 +0200
commit1b90ffc57336a74ba3417e8f7c0f75718d930dda (patch)
treed941fbba4891203602699bb229ee2e8f9a029f42 /config
parent3b10de4b5146d9f7d96194cfc70d3c9be2d53055 (diff)
downloadgitlab-ce-1b90ffc57336a74ba3417e8f7c0f75718d930dda.tar.gz
Adds tracing support for ActiveRecord notifications
This change will publish distributed tracing spans related to SQL ActiveRecord queries. These queries are unbound, so will still contain parameter substitution strings in place of actual parameter values. This ensures that the SQL strings do not need to be scrubbed, since the values are not included in the SQL. More details of rails instrumentation can be found here: https://guides.rubyonrails.org/active_support_instrumentation.html
Diffstat (limited to 'config')
-rw-r--r--config/initializers/tracing.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/config/initializers/tracing.rb b/config/initializers/tracing.rb
index 46e8125daf8..d5bef8edb43 100644
--- a/config/initializers/tracing.rb
+++ b/config/initializers/tracing.rb
@@ -23,6 +23,9 @@ if Gitlab::Tracing.enabled?
end
end
+ # Instrument Rails
+ Gitlab::Tracing::Rails::ActiveRecordSubscriber.instrument
+
# In multi-processed clustered architectures (puma, unicorn) don't
# start tracing until the worker processes are spawned. This works
# around issues when the opentracing implementation spawns threads