Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/metrics/transaction.rb')
-rw-r--r--lib/gitlab/metrics/transaction.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/gitlab/metrics/transaction.rb b/lib/gitlab/metrics/transaction.rb
index 97cc8bed564..56a310548a7 100644
--- a/lib/gitlab/metrics/transaction.rb
+++ b/lib/gitlab/metrics/transaction.rb
@@ -6,35 +6,14 @@ module Gitlab
class Transaction
include Gitlab::Metrics::Methods
- # base label keys shared among all transactions
- BASE_LABEL_KEYS = %i(controller action feature_category).freeze
# labels that potentially contain sensitive information and will be filtered
FILTERED_LABEL_KEYS = %i(branch path).freeze
- THREAD_KEY = :_gitlab_metrics_transaction
-
# The series to store events (e.g. Git pushes) in.
EVENT_SERIES = 'events'
attr_reader :method
- class << self
- def current
- Thread.current[THREAD_KEY]
- end
-
- def prometheus_metric(name, type, &block)
- fetch_metric(type, name) do
- # set default metric options
- docstring "#{name.to_s.humanize} #{type}"
-
- evaluate(&block)
- # always filter sensitive labels and merge with base ones
- label_keys BASE_LABEL_KEYS | (label_keys - FILTERED_LABEL_KEYS)
- end
- end
- end
-
def initialize
@methods = {}
end
@@ -126,10 +105,6 @@ module Gitlab
histogram.observe(filter_labels(labels), value)
end
- def labels
- BASE_LABEL_KEYS.product([nil]).to_h
- end
-
def filter_labels(labels)
labels.empty? ? self.labels : labels.without(*FILTERED_LABEL_KEYS).merge(self.labels)
end