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
14cc2c8a
Commit
14cc2c8a
authored
Oct 22, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Routes + query
parent
0366660c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
config/routes/project.rb
config/routes/project.rb
+4
-0
lib/gitlab/prometheus/query.rb
lib/gitlab/prometheus/query.rb
+17
-0
No files found.
config/routes/project.rb
View file @
14cc2c8a
...
@@ -73,6 +73,10 @@ constraints(ProjectUrlConstrainer.new) do
...
@@ -73,6 +73,10 @@ constraints(ProjectUrlConstrainer.new) do
resource
:mattermost
,
only:
[
:new
,
:create
]
resource
:mattermost
,
only:
[
:new
,
:create
]
namespace
:prometheus
do
namespace
:prometheus
do
resources
:metrics
,
constraints:
{
id:
/[^\/]+/
},
only:
[
:index
,
:show
,
:edit
,
:update
,
:destroy
]
do
post
:validate_query
get
:active
end
get
:active_metrics
get
:active_metrics
end
end
...
...
lib/gitlab/prometheus/query.rb
0 → 100644
View file @
14cc2c8a
module
Gitlab
module
Prometheus
class
Query
include
ActiveModel
::
Model
include
ActiveRecord
::
Base
attr_accessor
:unit
,
:series_dsl
,
:label
,
:type
,
track:
canary
validates
:title
,
:required_metrics
,
:weight
,
:y_label
,
:queries
,
presence:
true
def
initialize
(
params
=
{})
super
(
params
)
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