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
ea537e11
Commit
ea537e11
authored
Mar 23, 2020
by
Ryan Cobb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move param substitution to method
parent
ead1078f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
app/services/prometheus/proxy_service.rb
app/services/prometheus/proxy_service.rb
+11
-5
No files found.
app/services/prometheus/proxy_service.rb
View file @
ea537e11
...
...
@@ -114,11 +114,7 @@ module Prometheus
end
def
filter_params
(
params
,
path
)
start_time
=
params
[
:start_time
]
end_time
=
params
[
:end_time
]
params
[
'start'
]
=
start_time
if
start_time
params
[
'end'
]
=
end_time
if
end_time
params
=
substitute_params
(
params
)
params
.
slice
(
*
PROXY_SUPPORT
.
dig
(
path
,
:params
))
end
...
...
@@ -126,5 +122,15 @@ module Prometheus
def
can_proxy?
PROXY_SUPPORT
.
dig
(
@path
,
:method
)
&
.
include?
(
@method
)
end
def
substitute_params
(
params
)
start_time
=
params
[
:start_time
]
end_time
=
params
[
:end_time
]
params
[
'start'
]
=
start_time
if
start_time
params
[
'end'
]
=
end_time
if
end_time
params
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