Commit 24fc4495 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '59325-units-are-not-shown-on-the-performance-dashboard-2' into 'master'

fix: updates labels to include units in metrics

Closes #59325

See merge request gitlab-org/gitlab-ce!30330
parents fc3d0595 5a96c053
---
title: 'fix: updates to include units for the y axis label'
merge_request: 30330
author:
type: fixed
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
priority: 1 priority: 1
metrics: metrics:
- title: "CPU Usage" - title: "CPU Usage"
y_label: "CPU" y_label: "CPU (cores)"
required_metrics: ['container_cpu_usage_seconds_total'] required_metrics: ['container_cpu_usage_seconds_total']
weight: 1 weight: 1
queries: queries:
- query_range: 'avg(sum(rate(container_cpu_usage_seconds_total{id="/"}[15m])) by (job)) without (job)' - query_range: 'avg(sum(rate(container_cpu_usage_seconds_total{id="/"}[15m])) by (job)) without (job)'
label: Usage label: Usage (cores)
unit: "cores" unit: "cores"
appearance: appearance:
line: line:
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
area: area:
opacity: 0 opacity: 0
- query_range: 'sum(kube_pod_container_resource_requests_cpu_cores{kubernetes_namespace="gitlab-managed-apps"})' - query_range: 'sum(kube_pod_container_resource_requests_cpu_cores{kubernetes_namespace="gitlab-managed-apps"})'
label: Requested label: Requested (cores)
unit: "cores" unit: "cores"
appearance: appearance:
line: line:
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
area: area:
opacity: 0 opacity: 0
- query_range: 'sum(kube_node_status_capacity_cpu_cores{kubernetes_namespace="gitlab-managed-apps"})' - query_range: 'sum(kube_node_status_capacity_cpu_cores{kubernetes_namespace="gitlab-managed-apps"})'
label: Capacity label: Capacity (cores)
unit: "cores" unit: "cores"
appearance: appearance:
line: line:
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
area: area:
opacity: 0 opacity: 0
- title: "Memory usage" - title: "Memory usage"
y_label: "Memory" y_label: "Memory (GiB)"
required_metrics: ['container_memory_usage_bytes'] required_metrics: ['container_memory_usage_bytes']
weight: 1 weight: 1
queries: queries:
- query_range: 'avg(sum(container_memory_usage_bytes{id="/"}) by (job)) without (job) / 2^30' - query_range: 'avg(sum(container_memory_usage_bytes{id="/"}) by (job)) without (job) / 2^30'
label: Usage label: Usage (GiB)
unit: "GiB" unit: "GiB"
appearance: appearance:
line: line:
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
area: area:
opacity: 0 opacity: 0
- query_range: 'sum(kube_pod_container_resource_requests_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30' - query_range: 'sum(kube_pod_container_resource_requests_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30'
label: Requested label: Requested (GiB)
unit: "GiB" unit: "GiB"
appearance: appearance:
line: line:
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
area: area:
opacity: 0 opacity: 0
- query_range: 'sum(kube_node_status_capacity_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30' - query_range: 'sum(kube_node_status_capacity_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30'
label: Capacity label: Capacity (GiB)
unit: "GiB" unit: "GiB"
appearance: appearance:
line: line:
......
...@@ -21,16 +21,16 @@ panel_groups: ...@@ -21,16 +21,16 @@ panel_groups:
metrics: metrics:
- id: response_metrics_nginx_ingress_latency_pod_average - id: response_metrics_nginx_ingress_latency_pod_average
query_range: 'avg(nginx_upstream_response_msecs_avg{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"})' query_range: 'avg(nginx_upstream_response_msecs_avg{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"})'
label: Pod average label: Pod average (ms)
unit: ms unit: ms
- title: "HTTP Error Rate" - title: "HTTP Error Rate"
type: "area-chart" type: "area-chart"
y_label: "HTTP Errors" y_label: "HTTP Errors (%)"
weight: 1 weight: 1
metrics: metrics:
- id: response_metrics_nginx_ingress_http_error_rate - id: response_metrics_nginx_ingress_http_error_rate
query_range: 'sum(rate(nginx_upstream_responses_total{status_code="5xx", upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[2m])) / sum(rate(nginx_upstream_responses_total{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[2m])) * 100' query_range: 'sum(rate(nginx_upstream_responses_total{status_code="5xx", upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[2m])) / sum(rate(nginx_upstream_responses_total{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[2m])) * 100'
label: 5xx Errors label: 5xx Errors (%)
unit: "%" unit: "%"
# NGINX Ingress metrics for post-0.16.0 versions # NGINX Ingress metrics for post-0.16.0 versions
- group: Response metrics (NGINX Ingress) - group: Response metrics (NGINX Ingress)
...@@ -52,16 +52,16 @@ panel_groups: ...@@ -52,16 +52,16 @@ panel_groups:
metrics: metrics:
- id: response_metrics_nginx_ingress_16_latency_pod_average - id: response_metrics_nginx_ingress_16_latency_pod_average
query_range: 'sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_sum{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) / sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_count{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) * 1000' query_range: 'sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_sum{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) / sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_count{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) * 1000'
label: Pod average label: Pod average (ms)
unit: ms unit: ms
- title: "HTTP Error Rate" - title: "HTTP Error Rate"
type: "area-chart" type: "area-chart"
y_label: "HTTP Errors" y_label: "HTTP Errors (%)"
weight: 1 weight: 1
metrics: metrics:
- id: response_metrics_nginx_ingress_16_http_error_rate - id: response_metrics_nginx_ingress_16_http_error_rate
query_range: 'sum(rate(nginx_ingress_controller_requests{status=~"5.*",namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) / sum(rate(nginx_ingress_controller_requests{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) * 100' query_range: 'sum(rate(nginx_ingress_controller_requests{status=~"5.*",namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) / sum(rate(nginx_ingress_controller_requests{namespace="%{kube_namespace}",ingress=~".*%{ci_environment_slug}.*"}[2m])) * 100'
label: 5xx Errors label: 5xx Errors (%)
unit: "%" unit: "%"
- group: Response metrics (HA Proxy) - group: Response metrics (HA Proxy)
priority: 10 priority: 10
...@@ -82,7 +82,7 @@ panel_groups: ...@@ -82,7 +82,7 @@ panel_groups:
metrics: metrics:
- id: response_metrics_ha_proxy_http_error_rate - id: response_metrics_ha_proxy_http_error_rate
query_range: 'sum(rate(haproxy_frontend_http_responses_total{code="5xx",%{environment_filter}}[2m])) / sum(rate(haproxy_frontend_http_responses_total{%{environment_filter}}[2m]))' query_range: 'sum(rate(haproxy_frontend_http_responses_total{code="5xx",%{environment_filter}}[2m])) / sum(rate(haproxy_frontend_http_responses_total{%{environment_filter}}[2m]))'
label: HTTP Errors label: HTTP Errors (%)
unit: "%" unit: "%"
- group: Response metrics (AWS ELB) - group: Response metrics (AWS ELB)
priority: 10 priority: 10
...@@ -94,7 +94,7 @@ panel_groups: ...@@ -94,7 +94,7 @@ panel_groups:
metrics: metrics:
- id: response_metrics_aws_elb_throughput_requests - id: response_metrics_aws_elb_throughput_requests
query_range: 'sum(aws_elb_request_count_sum{%{environment_filter}}) / 60' query_range: 'sum(aws_elb_request_count_sum{%{environment_filter}}) / 60'
label: Total label: Total (req/sec)
unit: req / sec unit: req / sec
- title: "Latency" - title: "Latency"
type: "area-chart" type: "area-chart"
...@@ -103,7 +103,7 @@ panel_groups: ...@@ -103,7 +103,7 @@ panel_groups:
metrics: metrics:
- id: response_metrics_aws_elb_latency_average - id: response_metrics_aws_elb_latency_average
query_range: 'avg(aws_elb_latency_average{%{environment_filter}}) * 1000' query_range: 'avg(aws_elb_latency_average{%{environment_filter}}) * 1000'
label: Average label: Average (ms)
unit: ms unit: ms
- title: "HTTP Error Rate" - title: "HTTP Error Rate"
type: "area-chart" type: "area-chart"
...@@ -112,7 +112,7 @@ panel_groups: ...@@ -112,7 +112,7 @@ panel_groups:
metrics: metrics:
- id: response_metrics_aws_elb_http_error_rate - id: response_metrics_aws_elb_http_error_rate
query_range: 'sum(aws_elb_httpcode_backend_5_xx_sum{%{environment_filter}}) / sum(aws_elb_request_count_sum{%{environment_filter}})' query_range: 'sum(aws_elb_httpcode_backend_5_xx_sum{%{environment_filter}}) / sum(aws_elb_request_count_sum{%{environment_filter}})'
label: HTTP Errors label: HTTP Errors (%)
unit: "%" unit: "%"
- group: Response metrics (NGINX) - group: Response metrics (NGINX)
priority: 10 priority: 10
...@@ -133,9 +133,9 @@ panel_groups: ...@@ -133,9 +133,9 @@ panel_groups:
metrics: metrics:
- id: response_metrics_nginx_latency - id: response_metrics_nginx_latency
query_range: 'avg(nginx_server_requestMsec{%{environment_filter}})' query_range: 'avg(nginx_server_requestMsec{%{environment_filter}})'
label: Upstream label: Upstream (ms)
unit: ms unit: ms
- title: "HTTP Error Rate" - title: "HTTP Error Rate (Errors / Sec)"
type: "area-chart" type: "area-chart"
y_label: "HTTP 500 Errors / Sec" y_label: "HTTP 500 Errors / Sec"
weight: 1 weight: 1
...@@ -149,12 +149,12 @@ panel_groups: ...@@ -149,12 +149,12 @@ panel_groups:
panels: panels:
- title: "Memory Usage (Total)" - title: "Memory Usage (Total)"
type: "area-chart" type: "area-chart"
y_label: "Total Memory Used" y_label: "Total Memory Used (GB)"
weight: 4 weight: 4
metrics: metrics:
- id: system_metrics_kubernetes_container_memory_total - id: system_metrics_kubernetes_container_memory_total
query_range: 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) /1024/1024/1024' query_range: 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) /1024/1024/1024'
label: Total label: Total (GB)
unit: GB unit: GB
- title: "Core Usage (Total)" - title: "Core Usage (Total)"
type: "area-chart" type: "area-chart"
...@@ -163,25 +163,25 @@ panel_groups: ...@@ -163,25 +163,25 @@ panel_groups:
metrics: metrics:
- id: system_metrics_kubernetes_container_cores_total - id: system_metrics_kubernetes_container_cores_total
query_range: 'avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job)' query_range: 'avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job)'
label: Total label: Total (cores)
unit: "cores" unit: "cores"
- title: "Memory Usage (Pod average)" - title: "Memory Usage (Pod average)"
type: "area-chart" type: "area-chart"
y_label: "Memory Used per Pod" y_label: "Memory Used per Pod (MB)"
weight: 2 weight: 2
metrics: metrics:
- id: system_metrics_kubernetes_container_memory_average - id: system_metrics_kubernetes_container_memory_average
query_range: 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024' query_range: 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024'
label: Pod average label: Pod average (MB)
unit: MB unit: MB
- title: "Canary: Memory Usage (Pod Average)" - title: "Canary: Memory Usage (Pod Average)"
type: "area-chart" type: "area-chart"
y_label: "Memory Used per Pod" y_label: "Memory Used per Pod (MB)"
weight: 2 weight: 2
metrics: metrics:
- id: system_metrics_kubernetes_container_memory_average_canary - id: system_metrics_kubernetes_container_memory_average_canary
query_range: 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024' query_range: 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024'
label: Pod average label: Pod average (MB)
unit: MB unit: MB
track: canary track: canary
- title: "Core Usage (Pod Average)" - title: "Core Usage (Pod Average)"
...@@ -191,7 +191,7 @@ panel_groups: ...@@ -191,7 +191,7 @@ panel_groups:
metrics: metrics:
- id: system_metrics_kubernetes_container_core_usage - id: system_metrics_kubernetes_container_core_usage
query_range: 'avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job) / count(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}[15m])) by (pod_name))' query_range: 'avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job) / count(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}[15m])) by (pod_name))'
label: Pod average label: Pod average (cores)
unit: "cores" unit: "cores"
- title: "Canary: Core Usage (Pod Average)" - title: "Canary: Core Usage (Pod Average)"
type: "area-chart" type: "area-chart"
...@@ -200,7 +200,7 @@ panel_groups: ...@@ -200,7 +200,7 @@ panel_groups:
metrics: metrics:
- id: system_metrics_kubernetes_container_core_usage_canary - id: system_metrics_kubernetes_container_core_usage_canary
query_range: 'avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job) / count(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}[15m])) by (pod_name))' query_range: 'avg(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}[15m])) by (job)) without (job) / count(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",pod_name=~"^%{ci_environment_slug}-canary-(.*)",namespace="%{kube_namespace}"}[15m])) by (pod_name))'
label: Pod average label: Pod average (cores)
unit: "cores" unit: "cores"
track: canary track: canary
- title: "Knative function invocations" - title: "Knative function invocations"
......
# frozen_string_literal: true
class ImportCommonMetricsYAxis < ActiveRecord::Migration[5.1]
DOWNTIME = false
def up
::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
end
def down
# no-op
end
end
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