Commit 8ab79de8 authored by Alper Akgun's avatar Alper Akgun

Merge branch '323560-add-metrics-yaml-definitions-for-metrics-topology' into 'master'

Add Metrics YAML definitions for topology key

See merge request gitlab-org/gitlab!57231
parents 32feb49c b0af2d99
---
key_path: topology.failures
description: Contains information about failed queries
product_section: enablement
product_stage: enablement
product_group: group::memory
product_category:
value_type: number
status: data_available
time_frame: all
data_source: prometheus
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
skip_validation: true
{
"type": "object",
"required": ["duration", "failures"],
"properties": {
"duration": { "type": "number", "description": "The time it took to collect topology data" },
"failures": { "type": "array", "description": "The information about failed queries" },
"application_requests_per_hour": { "type": "number", "description": "The number of requests to the web application per hour" },
"nodes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"node_cpus": { "type": "number", "description": "The number of CPU cores of this node" },
"node_cpu_utilization": { "type": "number", "description": "The CPU utilization ratio of this node" },
"node_memory_total_bytes": { "type": "number", "description": "The total available memory of this node" },
"node_memory_utilization": { "type": "number", "description": "The memory utilization ratio of this node" },
"node_services": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string", "description": "The name of the GitLab service running on this node" },
"server": { "type": "string", "description": "The type of web server used (Unicorn or Puma)" },
"process_count": { "type": "number", "description": "The number of processes running for this service" },
"process_memory_rss": { "type": "number", "description": "The average Resident Set Size of a service process" },
"process_memory_uss": { "type": "number", "description": "The average Unique Set Size of a service process" },
"process_memory_pss": { "type": "number", "description": "The average Proportional Set Size of a service proces" }
}
}
},
"node_uname_info": {
"type": "object",
"properties": {
"machine": { "type": "string", "description": "The machine hardware name of this node" },
"release": { "type": "string", "description": "The operating system release of this node" },
"sysname": { "type": "string", "description": "The operating system name of this node" }
}
}
}
}
}
}
}
--- ---
key_path: topology.duration_s key_path: topology
description: Time it took to collect topology data description: Topology data
product_section: enablement product_section: enablement
product_stage: enablement product_stage: enablement
product_group: group::memory product_group: group::memory
product_category: product_category:
value_type: number value_type: object
status: data_available status: data_available
time_frame: all milestone: "13.11"
introduced_by_url: https://gitlab.com/groups/gitlab-org/-/epics/3209
time_frame: none
data_source: prometheus data_source: prometheus
distribution: distribution:
- ce - ce
...@@ -16,4 +18,4 @@ tier: ...@@ -16,4 +18,4 @@ tier:
- free - free
- premium - premium
- ultimate - ultimate
skip_validation: true object_json_schema: 'config/metrics/objects_schemas/topology_schema.json'
...@@ -14000,23 +14000,13 @@ Status: `data_available` ...@@ -14000,23 +14000,13 @@ Status: `data_available`
Tiers: `free`, `premium`, `ultimate` Tiers: `free`, `premium`, `ultimate`
### `topology.duration_s` ### `topology`
Time it took to collect topology data Topology data
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180922_duration_s.yml) [Object JSON schema](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/objects_schemas/topology_schema.json)
Group: `group::memory` [YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210323120839_topology.yml)
Status: `data_available`
Tiers: `free`, `premium`, `ultimate`
### `topology.failures`
Contains information about failed queries
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180924_failures.yml)
Group: `group::memory` Group: `group::memory`
......
...@@ -33,6 +33,10 @@ module Gitlab ...@@ -33,6 +33,10 @@ module Gitlab
object[:description] object[:description]
end end
def render_object_schema(object)
"[Object JSON schema](#{object.json_schema_path})"
end
def render_yaml_link(yaml_path) def render_yaml_link(yaml_path)
"[YAML definition](#{yaml_path})" "[YAML definition](#{yaml_path})"
end end
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
= render_name(name) = render_name(name)
\ \
= render_description(object.attributes) = render_description(object.attributes)
- if object.has_json_schema?
\
= render_object_schema(object)
\ \
= render_yaml_link(object.yaml_path) = render_yaml_link(object.yaml_path)
\ \
......
...@@ -22,6 +22,16 @@ module Gitlab ...@@ -22,6 +22,16 @@ module Gitlab
attributes attributes
end end
def json_schema_path
return '' unless has_json_schema?
"#{BASE_REPO_PATH}/#{attributes[:object_json_schema]}"
end
def has_json_schema?
attributes[:value_type] == 'object' && attributes[:object_json_schema].present?
end
def yaml_path def yaml_path
"#{BASE_REPO_PATH}#{path.delete_prefix(Rails.root.to_s)}" "#{BASE_REPO_PATH}#{path.delete_prefix(Rails.root.to_s)}"
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