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
def94f50
Commit
def94f50
authored
Jul 03, 2019
by
Maneschi Romain
Committed by
Rémy Coutable
Jul 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Grafana to Admin > Monitoring menu when enabled
parent
6359a1fa
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
113 additions
and
0 deletions
+113
-0
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+2
-0
app/views/admin/application_settings/_grafana.html.haml
app/views/admin/application_settings/_grafana.html.haml
+17
-0
app/views/admin/application_settings/metrics_and_profiling.html.haml
...dmin/application_settings/metrics_and_profiling.html.haml
+11
-0
app/views/layouts/nav/sidebar/_admin.html.haml
app/views/layouts/nav/sidebar/_admin.html.haml
+5
-0
changelogs/unreleased/61005-grafanaInAdminSettingsMonitoringMenu.yml
...unreleased/61005-grafanaInAdminSettingsMonitoringMenu.yml
+5
-0
db/migrate/20190617123615_add_grafana_to_settings.rb
db/migrate/20190617123615_add_grafana_to_settings.rb
+18
-0
db/migrate/20190624123615_add_grafana_url_to_settings.rb
db/migrate/20190624123615_add_grafana_url_to_settings.rb
+18
-0
db/schema.rb
db/schema.rb
+2
-0
doc/administration/monitoring/performance/grafana_configuration.md
...istration/monitoring/performance/grafana_configuration.md
+15
-0
lib/api/settings.rb
lib/api/settings.rb
+2
-0
locale/gitlab.pot
locale/gitlab.pot
+18
-0
No files found.
app/helpers/application_settings_helper.rb
View file @
def94f50
...
...
@@ -187,6 +187,8 @@ module ApplicationSettingsHelper
:gitaly_timeout_default
,
:gitaly_timeout_medium
,
:gitaly_timeout_fast
,
:grafana_enabled
,
:grafana_url
,
:gravatar_enabled
,
:hashed_storage_enabled
,
:help_page_hide_commercial_content
,
...
...
app/views/admin/application_settings/_grafana.html.haml
0 → 100644
View file @
def94f50
=
form_for
@application_setting
,
url:
admin_application_settings_path
(
anchor:
'js-grafana-settings'
),
html:
{
class:
'fieldset-form'
}
do
|
f
|
=
form_errors
(
@application_setting
)
%fieldset
%p
=
_
(
"Add a Grafana button in the admin sidebar, monitoring section, to access a variety of statistics on the health and performance of GitLab."
)
=
link_to
icon
(
'question-circle'
),
help_page_path
(
'administration/monitoring/performance/grafana_configuration.md'
)
.form-group
.form-check
=
f
.
check_box
:grafana_enabled
,
class:
'form-check-input'
=
f
.
label
:grafana_enabled
,
class:
'form-check-label'
do
=
_
(
'Enable access to Grafana'
)
.form-group
=
f
.
label
:grafana_url
,
_
(
'Grafana URL'
),
class:
'label-bold'
=
f
.
text_field
:grafana_url
,
class:
'form-control'
,
placeholder:
'/-/grafana'
=
f
.
submit
_
(
'Save changes'
),
class:
"btn btn-success"
app/views/admin/application_settings/metrics_and_profiling.html.haml
View file @
def94f50
...
...
@@ -24,6 +24,17 @@
.settings-content
=
render
'prometheus'
%section
.settings.as-grafana.no-animate
#js-grafana-settings
{
class:
(
'expanded'
if
expanded_by_default?
)
}
.settings-header
%h4
=
_
(
'Metrics - Grafana'
)
%button
.btn.btn-default.js-settings-toggle
{
type:
'button'
}
=
expanded_by_default?
?
_
(
'Collapse'
)
:
_
(
'Expand'
)
%p
=
_
(
'Enable and configure Grafana.'
)
.settings-content
=
render
'grafana'
%section
.settings.qa-performance-bar-settings.as-performance-bar.no-animate
#js-performance-bar-settings
{
class:
(
'expanded'
if
expanded_by_default?
)
}
.settings-header
%h4
...
...
app/views/layouts/nav/sidebar/_admin.html.haml
View file @
def94f50
...
...
@@ -81,6 +81,11 @@
=
link_to
admin_requests_profiles_path
,
title:
_
(
'Requests Profiles'
)
do
%span
=
_
(
'Requests Profiles'
)
-
if
Gitlab
::
CurrentSettings
.
current_application_settings
.
grafana_enabled?
=
nav_link
do
=
link_to
Gitlab
::
CurrentSettings
.
current_application_settings
.
grafana_url
,
target:
'_blank'
,
title:
_
(
'Metrics Dashboard'
)
do
%span
=
_
(
'Metrics Dashboard'
)
=
render_if_exists
'layouts/nav/ee/admin/new_monitoring_sidebar'
=
nav_link
(
controller: :broadcast_messages
)
do
...
...
changelogs/unreleased/61005-grafanaInAdminSettingsMonitoringMenu.yml
0 → 100644
View file @
def94f50
---
title
:
Adds link to Grafana in Admin > Monitoring settings when grafana is enabled in config
merge_request
:
28937
author
:
Romain Maneschi
type
:
added
db/migrate/20190617123615_add_grafana_to_settings.rb
0 → 100644
View file @
def94f50
# frozen_string_literal: true
class
AddGrafanaToSettings
<
ActiveRecord
::
Migration
[
5.1
]
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
DOWNTIME
=
false
def
up
add_column_with_default
(
:application_settings
,
:grafana_enabled
,
:boolean
,
default:
false
,
allow_null:
false
)
end
def
down
remove_column
(
:application_settings
,
:grafana_enabled
)
end
end
db/migrate/20190624123615_add_grafana_url_to_settings.rb
0 → 100644
View file @
def94f50
# frozen_string_literal: true
class
AddGrafanaUrlToSettings
<
ActiveRecord
::
Migration
[
5.1
]
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
DOWNTIME
=
false
def
up
add_column_with_default
(
:application_settings
,
:grafana_url
,
:string
,
default:
'/-/grafana'
,
allow_null:
false
)
end
def
down
remove_column
(
:application_settings
,
:grafana_url
)
end
end
db/schema.rb
View file @
def94f50
...
...
@@ -193,6 +193,7 @@ ActiveRecord::Schema.define(version: 20190628185004) do
t
.
string
"required_instance_ci_template"
t
.
boolean
"dns_rebinding_protection_enabled"
,
default:
true
,
null:
false
t
.
boolean
"default_project_deletion_protection"
,
default:
false
,
null:
false
t
.
boolean
"grafana_enabled"
,
default:
false
,
null:
false
t
.
boolean
"lock_memberships_to_ldap"
,
default:
false
,
null:
false
t
.
text
"help_text"
t
.
boolean
"elasticsearch_indexing"
,
default:
false
,
null:
false
...
...
@@ -226,6 +227,7 @@ ActiveRecord::Schema.define(version: 20190628185004) do
t
.
boolean
"elasticsearch_limit_indexing"
,
default:
false
,
null:
false
t
.
string
"geo_node_allowed_ips"
,
default:
"0.0.0.0/0, ::/0"
t
.
boolean
"time_tracking_limit_to_hours"
,
default:
false
,
null:
false
t
.
string
"grafana_url"
,
default:
"/-/grafana"
,
null:
false
t
.
index
[
"custom_project_templates_group_id"
],
name:
"index_application_settings_on_custom_project_templates_group_id"
,
using: :btree
t
.
index
[
"file_template_project_id"
],
name:
"index_application_settings_on_file_template_project_id"
,
using: :btree
t
.
index
[
"usage_stats_set_by_user_id"
],
name:
"index_application_settings_on_usage_stats_set_by_user_id"
,
using: :btree
...
...
doc/administration/monitoring/performance/grafana_configuration.md
View file @
def94f50
...
...
@@ -103,6 +103,21 @@ repository for more information on this process.
[
grafana-dashboards
]:
https://gitlab.com/gitlab-org/grafana-dashboards
## Integration with GitLab UI
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/61005) in GitLab 12.1.
If you have set up Grafana, you can enable a link to access it easily from the sidebar:
1.
Go to the admin area under
**Settings > Metrics and profiling**
and expand "Metrics - Grafana".
1.
Check the "Enable access to Grafana" checkbox.
1.
If Grafana is enabled through Omnibus GitLab and on the same server,
leave "Grafana URL" unchanged. In any other case, enter the full URL
path of the Grafana instance.
1.
Click
**Save changes**
.
1.
The new link will be available in the admin area under
**Monitoring > Metrics Dashboard**
.
---
Read more on:
...
...
lib/api/settings.rb
View file @
def94f50
...
...
@@ -55,6 +55,8 @@ module API
optional
:gitaly_timeout_default
,
type:
Integer
,
desc:
'Default Gitaly timeout, in seconds. Set to 0 to disable timeouts.'
optional
:gitaly_timeout_fast
,
type:
Integer
,
desc:
'Gitaly fast operation timeout, in seconds. Set to 0 to disable timeouts.'
optional
:gitaly_timeout_medium
,
type:
Integer
,
desc:
'Medium Gitaly timeout, in seconds. Set to 0 to disable timeouts.'
optional
:grafana_enabled
,
type:
Boolean
,
desc:
'Enable Grafana'
optional
:grafana_url
,
type:
String
,
desc:
'Grafana URL'
optional
:gravatar_enabled
,
type:
Boolean
,
desc:
'Flag indicating if the Gravatar service is enabled'
optional
:help_page_hide_commercial_content
,
type:
Boolean
,
desc:
'Hide marketing-related entries from help'
optional
:help_page_support_url
,
type:
String
,
desc:
'Alternate support URL for help page'
...
...
locale/gitlab.pot
View file @
def94f50
...
...
@@ -605,6 +605,9 @@ msgstr ""
msgid "Add a GPG key"
msgstr ""
msgid "Add a Grafana button in the admin sidebar, monitoring section, to access a variety of statistics on the health and performance of GitLab."
msgstr ""
msgid "Add a bullet list"
msgstr ""
...
...
@@ -3923,9 +3926,15 @@ msgstr ""
msgid "Enable HTML emails"
msgstr ""
msgid "Enable access to Grafana"
msgstr ""
msgid "Enable access to the Performance Bar for a given group."
msgstr ""
msgid "Enable and configure Grafana."
msgstr ""
msgid "Enable and configure InfluxDB metrics."
msgstr ""
...
...
@@ -4933,6 +4942,9 @@ msgstr ""
msgid "Got it!"
msgstr ""
msgid "Grafana URL"
msgstr ""
msgid "Grant access"
msgstr ""
...
...
@@ -6391,12 +6403,18 @@ msgstr ""
msgid "Metrics"
msgstr ""
msgid "Metrics - Grafana"
msgstr ""
msgid "Metrics - Influx"
msgstr ""
msgid "Metrics - Prometheus"
msgstr ""
msgid "Metrics Dashboard"
msgstr ""
msgid "Metrics and profiling"
msgstr ""
...
...
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