summaryrefslogtreecommitdiff
path: root/spec/fixtures/lib/gitlab/metrics
diff options
context:
space:
mode:
Diffstat (limited to 'spec/fixtures/lib/gitlab/metrics')
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_groups_missing_panels_and_group.yml33
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_is_an_array.yml15
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_missing_panel_groups.yml32
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_panel_is_missing_metrics.yml15
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_panle_groups_wrong_content_type.yml33
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/duplicate_id_dashboard.yml67
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/invalid_dashboard.yml67
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml35
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metrics.json4
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panel_groups.json1
-rw-r--r--spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panels.json1
11 files changed, 284 insertions, 19 deletions
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_groups_missing_panels_and_group.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_groups_missing_panels_and_group.yml
new file mode 100644
index 00000000000..746a90f266e
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_groups_missing_panels_and_group.yml
@@ -0,0 +1,33 @@
+dashboard: 'Test Dashboard'
+panel_groups:
+- panels:
+ - title: "Super Chart A1"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 1
+ max_value: 1
+ metrics:
+ - id: metric_a1
+ 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
+ unit: unit
+ label: Legend Label
+ - title: "Super Chart A2"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 2
+ metrics:
+ - id: metric_a2
+ query_range: 'query'
+ label: Legend Label
+ unit: unit
+- group: Group B
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_is_an_array.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_is_an_array.yml
new file mode 100644
index 00000000000..7627592553e
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_is_an_array.yml
@@ -0,0 +1,15 @@
+---
+- dashboard: 'Test Dashboard'
+ panel_groups:
+ - group: Group A
+ panels:
+ - title: "Super Chart A2"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 2
+ metrics:
+ - id: metric_a2
+ query_range: 'query'
+ label: Legend Label
+ unit: unit
+- dashboard: 'second entry'
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_missing_panel_groups.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_missing_panel_groups.yml
new file mode 100644
index 00000000000..6f9e22c3212
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_missing_panel_groups.yml
@@ -0,0 +1,32 @@
+dashboard: 'Test Dashboard'
+priority: 1
+links:
+ - title: Link 1
+ url: https://gitlab.com
+ - title: Link 2
+ url: https://docs.gitlab.com
+templating:
+ variables:
+ text_variable_full_syntax:
+ label: 'Variable 1'
+ type: text
+ options:
+ default_value: 'default'
+ text_variable_simple_syntax: 'default value'
+ custom_variable_simple_syntax: ['value1', 'value2', 'value3']
+ custom_variable_full_syntax:
+ label: 'Variable 2'
+ type: custom
+ options:
+ values:
+ - value: 'value option 1'
+ text: 'Option 1'
+ - value: 'value_option_2'
+ text: 'Option 2'
+ default: true
+ metric_label_values_variable:
+ label: 'Variable 3'
+ type: metric_label_values
+ options:
+ series_selector: 'backend:haproxy_backend_availability:ratio{env="{{env}}"}'
+ label: 'backend'
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_panel_is_missing_metrics.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_panel_is_missing_metrics.yml
new file mode 100644
index 00000000000..8f12365dca2
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_panel_is_missing_metrics.yml
@@ -0,0 +1,15 @@
+dashboard: 'Test Dashboard'
+panel_groups:
+- group: Group A
+ priority: 1
+ panels:
+ - title: "Super Chart A1"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 1
+ max_value: 1
+ - title: "Super Chart A2"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 2
+ metrics:
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_panle_groups_wrong_content_type.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_panle_groups_wrong_content_type.yml
new file mode 100644
index 00000000000..104107fa96e
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/dashboard_panle_groups_wrong_content_type.yml
@@ -0,0 +1,33 @@
+dashboard: 'Test Dashboard'
+priority: 1
+links:
+- title: Link 1
+ url: https://gitlab.com
+- title: Link 2
+ url: https://docs.gitlab.com
+templating:
+ variables:
+ text_variable_full_syntax:
+ label: 'Variable 1'
+ type: text
+ options:
+ default_value: 'default'
+ text_variable_simple_syntax: 'default value'
+ custom_variable_simple_syntax: ['value1', 'value2', 'value3']
+ custom_variable_full_syntax:
+ label: 'Variable 2'
+ type: custom
+ options:
+ values:
+ - value: 'value option 1'
+ text: 'Option 1'
+ - value: 'value_option_2'
+ text: 'Option 2'
+ default: true
+ metric_label_values_variable:
+ label: 'Variable 3'
+ type: metric_label_values
+ options:
+ series_selector: 'backend:haproxy_backend_availability:ratio{env="{{env}}"}'
+ label: 'backend'
+panel_groups: this should be an array
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/duplicate_id_dashboard.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/duplicate_id_dashboard.yml
new file mode 100644
index 00000000000..09a87703bfa
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/duplicate_id_dashboard.yml
@@ -0,0 +1,67 @@
+dashboard: 'Test Dashboard'
+priority: 1
+links:
+- title: Link 1
+ url: https://gitlab.com
+- title: Link 2
+ url: https://docs.gitlab.com
+templating:
+ variables:
+ text_variable_full_syntax:
+ label: 'Variable 1'
+ type: text
+ options:
+ default_value: 'default'
+ text_variable_simple_syntax: 'default value'
+ custom_variable_simple_syntax: ['value1', 'value2', 'value3']
+ custom_variable_full_syntax:
+ label: 'Variable 2'
+ type: custom
+ options:
+ values:
+ - value: 'value option 1'
+ text: 'Option 1'
+ - value: 'value_option_2'
+ text: 'Option 2'
+ default: true
+ metric_label_values_variable:
+ label: 'Variable 3'
+ type: metric_label_values
+ options:
+ series_selector: 'backend:haproxy_backend_availability:ratio{env="{{env}}"}'
+ label: 'backend'
+panel_groups:
+- group: Group A
+ priority: 1
+ panels:
+ - title: "Super Chart A1"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 1
+ max_value: 1
+ metrics:
+ - id: metric_a1
+ query_range: 'query'
+ unit: unit
+ label: Legend Label
+ - title: "Super Chart A2"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 2
+ metrics:
+ - id: metric_a1
+ query_range: 'query'
+ label: Legend Label
+ unit: unit
+- group: Group B
+ priority: 10
+ panels:
+ - title: "Super Chart B"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 1
+ metrics:
+ - id: metric_a1
+ query_range: 'query'
+ unit: unit
+ label: Legend Label
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/invalid_dashboard.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/invalid_dashboard.yml
new file mode 100644
index 00000000000..312053d2770
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/invalid_dashboard.yml
@@ -0,0 +1,67 @@
+dashboard: 'Test Dashboard'
+priority: 1
+links:
+- title: Link 1
+ url: https://gitlab.com
+- title: Link 2
+ url: https://docs.gitlab.com
+templating:
+ variables:
+ text_variable_full_syntax:
+ label: 'Variable 1'
+ type: text
+ options:
+ default_value: 'default'
+ text_variable_simple_syntax: 'default value'
+ custom_variable_simple_syntax: ['value1', 'value2', 'value3']
+ custom_variable_full_syntax:
+ label: 'Variable 2'
+ type: custom
+ options:
+ values:
+ - value: 'value option 1'
+ text: 'Option 1'
+ - value: 'value_option_2'
+ text: 'Option 2'
+ default: true
+ metric_label_values_variable:
+ label: 'Variable 3'
+ type: metric_label_values
+ options:
+ series_selector: 'backend:haproxy_backend_availability:ratio{env="{{env}}"}'
+ label: 'backend'
+panel_groups:
+- group: Group A
+ priority: 1
+ panels:
+ - title: "Super Chart A1"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: this_should_be_a_int
+ max_value: 1
+ metrics:
+ - id: metric_a1
+ query_range: 'query'
+ unit: unit
+ label: Legend Label
+ - title: "Super Chart A2"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 2
+ metrics:
+ - id: metric_a2
+ query_range: 'query'
+ label: Legend Label
+ unit: unit
+- group: Group B
+ priority: 10
+ panels:
+ - title: "Super Chart B"
+ type: "area-chart"
+ y_label: "y_label"
+ weight: 1
+ metrics:
+ - id: metric_b
+ query_range: 'query'
+ unit: unit
+ label: Legend Label
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml b/spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml
index 1e41ef669d1..17b9552763a 100644
--- a/spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml
@@ -31,37 +31,42 @@ templating:
series_selector: 'backend:haproxy_backend_availability:ratio{env="{{env}}"}'
label: 'backend'
panel_groups:
-- group: Group A
- priority: 1
+- group: Group B
panels:
- - title: "Super Chart A1"
+ - title: "Super Chart B"
type: "area-chart"
y_label: "y_label"
- weight: 1
- max_value: 1
metrics:
- - id: metric_a1
+ - id: metric_b
query_range: 'query'
unit: unit
label: Legend Label
+- group: Group A
+ panels:
- title: "Super Chart A2"
type: "area-chart"
y_label: "y_label"
- weight: 2
metrics:
- id: metric_a2
- query_range: 'query'
+ query_range: 2000
label: Legend Label
unit: unit
-- group: Group B
- priority: 10
- panels:
- - title: "Super Chart B"
+ - title: "Super Chart A1"
type: "area-chart"
y_label: "y_label"
- weight: 1
+ max_value: 1
metrics:
- - id: metric_b
- query_range: 'query'
+ - id: metric_a1
+ 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
unit: unit
label: Legend Label
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metrics.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metrics.json
index 038f5ac5d4e..b23b0ea15d2 100644
--- a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metrics.json
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/metrics.json
@@ -10,8 +10,8 @@
],
"properties": {
"id": { "type": "string" },
- "query_range": { "type": "string" },
- "query": { "type": "string" },
+ "query_range": { "type": ["string", "number"] },
+ "query": { "type": ["string", "number"] },
"unit": { "type": "string" },
"label": { "type": "string" },
"track": { "type": "string" },
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panel_groups.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panel_groups.json
index d16fcd40359..71c0981d9ec 100644
--- a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panel_groups.json
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panel_groups.json
@@ -6,7 +6,6 @@
],
"properties": {
"group": { "type": "string" },
- "priority": { "type": "number" },
"panels": {
"type": "array",
"items": { "$ref": "panels.json" }
diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panels.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panels.json
index 20595cc0d73..b4809a85101 100644
--- a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panels.json
+++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/panels.json
@@ -12,7 +12,6 @@
"y_label": { "type": "string" },
"y_axis": { "$ref": "axis.json" },
"max_value": { "type": "number" },
- "weight": { "type": "number" },
"metrics": {
"type": "array",
"items": { "$ref": "metrics.json" }