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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
c2854617
Commit
c2854617
authored
May 19, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prometheus settings
parent
6b9a091c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+1
-0
db/schema.rb
db/schema.rb
+1
-0
lib/api/settings.rb
lib/api/settings.rb
+1
-0
lib/gitlab/metrics.rb
lib/gitlab/metrics.rb
+10
-10
No files found.
app/controllers/admin/application_settings_controller.rb
View file @
c2854617
...
...
@@ -149,6 +149,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:version_check_enabled
,
:terminal_max_session_time
,
:polling_interval_multiplier
,
:prometheus_metrics_enabled
,
:usage_ping_enabled
,
disabled_oauth_sign_in_sources:
[],
...
...
db/schema.rb
View file @
c2854617
...
...
@@ -123,6 +123,7 @@ ActiveRecord::Schema.define(version: 20170525174156) do
t
.
integer
"cached_markdown_version"
t
.
boolean
"clientside_sentry_enabled"
,
default:
false
,
null:
false
t
.
string
"clientside_sentry_dsn"
t
.
boolean
"prometheus_metrics_enabled"
,
default:
false
,
null:
false
end
create_table
"audit_events"
,
force: :cascade
do
|
t
|
...
...
lib/api/settings.rb
View file @
c2854617
...
...
@@ -110,6 +110,7 @@ module API
optional
:default_artifacts_expire_in
,
type:
String
,
desc:
"Set the default expiration time for each job's artifacts"
optional
:max_pages_size
,
type:
Integer
,
desc:
'Maximum size of pages in MB'
optional
:container_registry_token_expire_delay
,
type:
Integer
,
desc:
'Authorization token duration (minutes)'
optional
:prometheus_metrics_enabled
,
type:
Boolean
,
desc:
'Enable Prometheus metrics'
optional
:metrics_enabled
,
type:
Boolean
,
desc:
'Enable the InfluxDB metrics'
given
metrics_enabled:
->
(
val
)
{
val
}
do
requires
:metrics_host
,
type:
String
,
desc:
'The InfluxDB host'
...
...
lib/gitlab/metrics.rb
View file @
c2854617
...
...
@@ -10,15 +10,15 @@ module Gitlab
def
self
.
settings
@settings
||=
{
enabled:
current_application_settings
[
:metrics_enabled
],
prometheus_metrics_enabled:
true
,
pool_size:
current_application_settings
[
:metrics_pool_size
],
timeout:
current_application_settings
[
:metrics_timeout
],
method_call_threshold:
current_application_settings
[
:metrics_method_call_threshold
],
host:
current_application_settings
[
:metrics_host
],
port:
current_application_settings
[
:metrics_port
],
sample_interval:
current_application_settings
[
:metrics_sample_interval
]
||
15
,
packet_size:
current_application_settings
[
:metrics_packet_size
]
||
1
enabled:
current_application_settings
[
:metrics_enabled
],
prometheus_metrics_enabled:
current_application_settings
[
:prometheus_metrics_enabled
]
,
pool_size:
current_application_settings
[
:metrics_pool_size
],
timeout:
current_application_settings
[
:metrics_timeout
],
method_call_threshold:
current_application_settings
[
:metrics_method_call_threshold
],
host:
current_application_settings
[
:metrics_host
],
port:
current_application_settings
[
:metrics_port
],
sample_interval:
current_application_settings
[
:metrics_sample_interval
]
||
15
,
packet_size:
current_application_settings
[
:metrics_packet_size
]
||
1
}
end
...
...
@@ -31,7 +31,7 @@ module Gitlab
end
def
self
.
enabled?
influx_metrics_enabled?
||
prometheus_metrics_enabled?
||
false
influx_metrics_enabled?
||
prometheus_metrics_enabled?
end
def
self
.
mri?
...
...
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