Commit 5a1e492b authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'lm-rake-task-metrics' into 'master'

Create rake task that adds custom dashboard to ops and seeds an anomaly metric

See merge request gitlab-org/gitlab!29821
parents dfb38bf8 61586093
...@@ -27,6 +27,26 @@ namespace :gitlab do ...@@ -27,6 +27,26 @@ namespace :gitlab do
query: 'sum(kube_pod_container_resource_requests_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30', query: 'sum(kube_pod_container_resource_requests_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30',
legend: 'Requested (GiB)' legend: 'Requested (GiB)'
) )
project = Project.find(args.project_id)
content = File.read(Rails.root.join('spec', 'fixtures', 'lib', 'gitlab', 'metrics', 'dashboard', 'development_metrics.yml'))
file_attributes = [
project.creator,
'.gitlab/dashboards/development_metrics.yml',
content,
{
message: 'Seeded development metrics',
branch_name: 'master'
}
]
begin
project.repository.create_file(*file_attributes)
rescue Gitlab::Git::Index::IndexError => error
raise error unless error.message == 'A file with this name already exists'
project.repository.update_file(*file_attributes)
end
end end
end end
end end
panel_groups:
- group: 'Usage Variation'
panels:
- type: anomaly-chart
title: "Memory Usage Rate Anomalies"
y_label: "Memory Usage Rate"
metrics:
- id: container_memory_usage_bytes
query_range: avg(sum(rate(container_memory_usage_bytes[15m]))) /1024
label: "Memory Usage Rate"
unit: "kB"
- id: container_memory_usage_bytes_upper
query_range: 80000
label: "Memory Usage Rate Lower Limit"
unit: "kB"
- id: container_memory_usage_bytes_lower
query_range: 50000
label: "Memory Usage Rate Upper Limit"
unit: "kB"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment