Commit 40a675ab authored by Kamil Trzciński's avatar Kamil Trzciński

Fix MetricGroup overwrites

parent f0ba1b0e
......@@ -2,21 +2,21 @@ module EE
module Gitlab
module Prometheus
module MetricGroup
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
prepended do
def self.custom_metrics(project)
module ClassMethods
def custom_metrics(project)
project.prometheus_metrics.all.group_by(&:group_title).map do |name, metrics|
MetricGroup.new(name: name, priority: 0, metrics: metrics.map(&:to_query_metric))
::Gitlab::Prometheus::MetricGroup.new(name: name, priority: 0, metrics: metrics.map(&:to_query_metric))
end
end
override :for_project
def self.for_project(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