From 1b90ffc57336a74ba3417e8f7c0f75718d930dda Mon Sep 17 00:00:00 2001 From: Andrew Newdigate Date: Wed, 23 Jan 2019 16:53:23 +0200 Subject: 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 --- config/initializers/tracing.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') 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 -- cgit v1.2.1