Commit fb56b670 authored by Kamil Trzciński's avatar Kamil Trzciński

Improve EE::MetricGroup

parent bb65fc86
......@@ -2,7 +2,11 @@ module EE
module Gitlab
module Prometheus
module MetricGroup
module ClassMethods
extend ActiveSupport::Concern
class_methods do
extend ::Gitlab::Utils::Override
def custom_metrics(project)
project.prometheus_metrics.all.group_by(&:group_title).map do |name, metrics|
::Gitlab::Prometheus::MetricGroup.new(
......@@ -10,14 +14,11 @@ module EE
end
end
override :for_project
def for_project(project)
super + custom_metrics(project)
end
end
def self.prepended(base)
base.singleton_class.prepend ClassMethods
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment