summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-03-12 16:40:25 +0100
committerBob Van Landuyt <bob@gitlab.com>2017-03-13 08:27:52 +0100
commitb55936bf0beb2b21de793e3dfc350a6ca1445db1 (patch)
tree15542a0c24c006291b3fafb5b671b0227db95b04 /config
parent92f82773900882ce9769fc05ce214d240abd5a62 (diff)
downloadgitlab-ce-b55936bf0beb2b21de793e3dfc350a6ca1445db1.tar.gz
Don't instrument `app/services/concerns`
Diffstat (limited to 'config')
-rw-r--r--config/initializers/8_metrics.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb
index a1517e6afc8..3e1657b8382 100644
--- a/config/initializers/8_metrics.rb
+++ b/config/initializers/8_metrics.rb
@@ -20,13 +20,17 @@ def instrument_classes(instrumentation)
# Path to search => prefix to strip from constant
paths_to_instrument = {
- %w(app finders) => %w(app finders),
- %w(app mailers emails) => %w(app mailers),
- %w(app services **) => %w(app services),
- %w(lib gitlab conflicts) => ['lib'],
- %w(lib gitlab diff) => ['lib'],
- %w(lib gitlab email message) => ['lib'],
- %w(lib gitlab checks) => ['lib']
+ %w(app finders) => %w(app finders),
+ %w(app mailers emails) => %w(app mailers),
+ # Don't instrument `app/services/concerns`
+ # It contains modules that are included in the services.
+ # The services themselves are instrumented so the methods from the modules
+ # are included.
+ %w(app services [^concerns]**) => %w(app services),
+ %w(lib gitlab conflicts) => ['lib'],
+ %w(lib gitlab diff) => ['lib'],
+ %w(lib gitlab email message) => ['lib'],
+ %w(lib gitlab checks) => ['lib']
}
paths_to_instrument.each do |(path, prefix)|