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

Fix MetricGroup overwrites

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