summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-01-12 15:41:22 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2016-01-12 15:41:22 +0100
commit355c341fe7c6b7c503386cf0b0e39cc02dbc8902 (patch)
treeefb68612b2dd9858b0ae311d63e56bd075bafa74 /lib
parent587f850170a38e2642c0de76fb69efdeae930d66 (diff)
downloadgitlab-ce-355c341fe7c6b7c503386cf0b0e39cc02dbc8902.tar.gz
Stop tracking call stacks for instrumented viewsremove-application-frames-from-views
Where a vew is called from doesn't matter as much. We already know what action they belong to and this is more than enough information. By removing the file/line number from the list of tags we should also be able to reduce the number of series stored in InfluxDB.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/metrics.rb14
-rw-r--r--lib/gitlab/metrics/subscribers/action_view.rb10
2 files changed, 1 insertions, 23 deletions
diff --git a/lib/gitlab/metrics.rb b/lib/gitlab/metrics.rb
index 44356a0e42c..cdf7c168ff2 100644
--- a/lib/gitlab/metrics.rb
+++ b/lib/gitlab/metrics.rb
@@ -36,20 +36,6 @@ module Gitlab
@pool
end
- # Returns a relative path and line number based on the last application call
- # frame.
- def self.last_relative_application_frame
- frame = caller_locations.find do |l|
- l.path.start_with?(RAILS_ROOT) && !l.path.start_with?(METRICS_ROOT)
- end
-
- if frame
- return frame.path.sub(PATH_REGEX, ''), frame.lineno
- else
- return nil, nil
- end
- end
-
def self.submit_metrics(metrics)
prepared = prepare_metrics(metrics)
diff --git a/lib/gitlab/metrics/subscribers/action_view.rb b/lib/gitlab/metrics/subscribers/action_view.rb
index 7c0105d543a..2e9dd4645e3 100644
--- a/lib/gitlab/metrics/subscribers/action_view.rb
+++ b/lib/gitlab/metrics/subscribers/action_view.rb
@@ -33,16 +33,8 @@ module Gitlab
def tags_for(event)
path = relative_path(event.payload[:identifier])
- tags = { view: path }
- file, line = Metrics.last_relative_application_frame
-
- if file and line
- tags[:file] = file
- tags[:line] = line
- end
-
- tags
+ { view: path }
end
def current_transaction