Commit ebb37a64 authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak

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

Add Metrics definition JSON schema for histogram metric

See merge request gitlab-org/gitlab!58056
parents e1e0c9a6 858086db
......@@ -18,3 +18,4 @@ tier:
- free
- premium
- ultimate
value_json_schema: 'config/metrics/objects_schemas/projects_with_enabled_alert_integrations_histogram.json'
{
"type": "object",
"description": "Histogram (buckets 1 to 100) of projects with at least 1 enabled integration"
"propertyNames": {
"pattern": "^[1-9][0-9]?0?$"
}
}
......@@ -67,6 +67,9 @@
},
"skip_validation": {
"type": "boolean"
},
"value_json_schema": {
"type": "string"
}
}
}
......@@ -18,4 +18,4 @@ tier:
- free
- premium
- ultimate
object_json_schema: 'config/metrics/objects_schemas/topology_schema.json'
value_json_schema: 'config/metrics/objects_schemas/topology_schema.json'
......@@ -26,11 +26,11 @@ module Gitlab
def json_schema_path
return '' unless has_json_schema?
"#{BASE_REPO_PATH}/#{attributes[:object_json_schema]}"
"#{BASE_REPO_PATH}/#{attributes[:value_json_schema]}"
end
def has_json_schema?
attributes[:value_type] == 'object' && attributes[:object_json_schema].present?
attributes[:value_type] == 'object' && attributes[:value_json_schema].present?
end
def yaml_path
......
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