Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
40a675ab
Commit
40a675ab
authored
Sep 04, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MetricGroup overwrites
parent
f0ba1b0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
ee/lib/ee/gitlab/prometheus/metric_group.rb
ee/lib/ee/gitlab/prometheus/metric_group.rb
+23
-0
No files found.
ee/lib/gitlab/prometheus/metric_group.rb
→
ee/lib/
ee/
gitlab/prometheus/metric_group.rb
View file @
40a675ab
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment