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
88bf82cf
Commit
88bf82cf
authored
Apr 07, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modifies setup of rake task
parent
f5d395fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
29 deletions
+31
-29
doc/development/rake_tasks.md
doc/development/rake_tasks.md
+1
-1
ee/lib/tasks/gitlab/seed/metrics.rake
ee/lib/tasks/gitlab/seed/metrics.rake
+30
-28
No files found.
doc/development/rake_tasks.md
View file @
88bf82cf
...
@@ -72,7 +72,7 @@ A lot of different types of metrics are supported in the monitoring dashboard.
...
@@ -72,7 +72,7 @@ A lot of different types of metrics are supported in the monitoring dashboard.
To import these metrics, you can run:
To import these metrics, you can run:
```
shell
```
shell
sudo
gitlab-rake
'metrics:setup_
development_metrics[your_project_id]'
bundle
exec
rake
'gitlab:seed:
development_metrics[your_project_id]'
```
```
### Automation
### Automation
...
...
ee/lib/tasks/gitlab/seed/metrics.rake
View file @
88bf82cf
namespace
:metrics
do
namespace
:gitlab
do
desc
"GitLab | Metrics | Setup development metrics"
namespace
:seed
do
task
:setup_development_metrics
,
[
:project_id
]
=>
:gitlab_environment
do
|
_
,
args
|
desc
"GitLab | Metrics | Setup development metrics"
shared_multi_metrics_attributes
=
{
task
:development_metrics
,
[
:project_id
]
=>
:gitlab_environment
do
|
_
,
args
|
title:
'Memory multi metric'
,
shared_multi_metrics_attributes
=
{
y_label:
'Memory (GiB)'
,
title:
'Memory multi metric'
,
project_id:
args
[
:project_id
],
y_label:
'Memory (GiB)'
,
unit:
'GiB'
,
project_id:
args
.
project_id
,
group:
'system'
unit:
'GiB'
,
}
group:
'system'
PrometheusMetric
.
find_or_create_by
(
}
**
shared_multi_metrics_attributes
,
PrometheusMetric
.
find_or_create_by
(
identifier:
'additional_system_metrics_container_memory_usage'
,
**
shared_multi_metrics_attributes
,
legend:
'Usage (GiB)'
,
identifier:
"
#{
args
.
project_id
}
-additional_system_metrics_container_memory_usage"
,
query:
'avg(sum(container_memory_usage_bytes{id="/"}) by (job)) without (job) / 2^30'
legend:
'Usage (GiB)'
,
)
query:
'avg(sum(container_memory_usage_bytes{id="/"}) by (job)) without (job) / 2^30'
PrometheusMetric
.
find_or_create_by
(
)
**
shared_multi_metrics_attributes
,
PrometheusMetric
.
find_or_create_by
(
identifier:
'additional_system_metrics_kube_node_status_capacity_memory_bytes'
,
**
shared_multi_metrics_attributes
,
query:
'sum(kube_node_status_capacity_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30'
,
identifier:
"
#{
args
.
project_id
}
-additional_system_metrics_kube_node_status_capacity_memory_bytes"
,
legend:
'Capacity (GiB)'
query:
'sum(kube_node_status_capacity_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30'
,
)
legend:
'Capacity (GiB)'
PrometheusMetric
.
find_or_create_by
(
)
**
shared_multi_metrics_attributes
,
PrometheusMetric
.
find_or_create_by
(
identifier:
'additional_system_metrics_kube_pod_container_resource_requests_memory_bytes'
,
**
shared_multi_metrics_attributes
,
query:
'sum(kube_pod_container_resource_requests_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30'
,
identifier:
"
#{
args
.
project_id
}
additional_system_metrics_kube_pod_container_resource_requests_memory_bytes"
,
legend:
'Requested (GiB)'
query:
'sum(kube_pod_container_resource_requests_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30'
,
)
legend:
'Requested (GiB)'
)
end
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