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
f78fd3de
Commit
f78fd3de
authored
Jun 08, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Additional metrics filtering
+ remove test button that was leftover after a bad merge
parent
6eb96b20
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
6 deletions
+9
-6
app/models/project_services/prometheus_service.rb
app/models/project_services/prometheus_service.rb
+5
-1
app/views/projects/services/_form.html.haml
app/views/projects/services/_form.html.haml
+0
-1
lib/gitlab/prometheus/additional_metrics_parser.rb
lib/gitlab/prometheus/additional_metrics_parser.rb
+2
-2
lib/gitlab/prometheus/metric_group.rb
lib/gitlab/prometheus/metric_group.rb
+1
-1
lib/gitlab/prometheus/queries/query_additional_metrics.rb
lib/gitlab/prometheus/queries/query_additional_metrics.rb
+1
-1
No files found.
app/models/project_services/prometheus_service.rb
View file @
f78fd3de
...
...
@@ -72,7 +72,11 @@ class PrometheusService < MonitoringService
end
def
matched_metrics
additional_deployment_metrics
(
Gitlab
::
Prometheus
::
Queries
::
MatchedMetricsQuery
.
name
,
&
:itself
)
with_reactive_cache
(
Gitlab
::
Prometheus
::
Queries
::
MatchedMetricsQuery
.
name
,
&
:itself
)
end
def
with_reactive_cache
(
*
args
,
&
block
)
yield
calculate_reactive_cache
(
*
args
)
end
# Cache metrics for specific environment
...
...
app/views/projects/services/_form.html.haml
View file @
f78fd3de
...
...
@@ -22,7 +22,6 @@
-
disabled_class
=
'disabled'
-
disabled_title
=
@service
.
disabled_title
=
link_to
'Test settings'
,
test_namespace_project_service_path
(
@project
.
namespace
,
@project
,
@service
),
class:
"btn
#{
disabled_class
}
"
,
title:
disabled_title
=
link_to
'Cancel'
,
namespace_project_settings_integrations_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-cancel'
-
if
lookup_context
.
template_exists?
(
'show'
,
"projects/services/
#{
@service
.
to_param
}
"
,
true
)
...
...
lib/gitlab/prometheus/additional_metrics_parser.rb
View file @
f78fd3de
...
...
@@ -4,7 +4,7 @@ module Gitlab
extend
self
def
load_groups_from_yaml
additional_metrics_raw
.
map
(
&
method
(
:
new
))
additional_metrics_raw
.
map
(
&
method
(
:
group_from_entry
))
end
private
...
...
@@ -25,7 +25,7 @@ module Gitlab
raise
ParsingError
.
new
(
"entry missing required fields
#{
missing_fields
}
"
)
unless
missing_fields
.
empty?
group
=
MetricGroup
.
new
(
entry
[
:group
],
entry
[
:priority
])
group
.
tap
{
|
g
|
g
.
metrics
=
Metric
.
metrics_from_list
(
entry
[
:metrics
])
}
group
.
tap
{
|
g
|
g
.
metrics
=
metrics_from_list
(
entry
[
:metrics
])
}
end
def
additional_metrics_raw
...
...
lib/gitlab/prometheus/metric_group.rb
View file @
f78fd3de
...
...
@@ -4,7 +4,7 @@ module Gitlab
attr_reader
:priority
,
:name
attr_accessor
:metrics
def
initialize
(
name
:,
priority
:,
metrics:
[])
def
initialize
(
name
,
priority
,
metrics
=
[])
@name
=
name
@priority
=
priority
@metrics
=
metrics
...
...
lib/gitlab/prometheus/queries/query_additional_metrics.rb
View file @
f78fd3de
...
...
@@ -37,7 +37,7 @@ module Gitlab
def
query_with_result
(
query
)
query
[
:result
]
&
.
any?
do
|
item
|
item
&
.
[
](
:values
)
&
.
any?
||
item
&
.
[
](
:value
)
&
.
any?
item
&
.
[
](
'values'
)
&
.
any?
||
item
&
.
[
](
'value'
)
&
.
any?
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