Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
chore: fix schema for services
Browse files Browse the repository at this point in the history
  • Loading branch information
minherz committed Jun 11, 2023
1 parent 165c600 commit e1b4c67
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 62 deletions.
6 changes: 3 additions & 3 deletions provisioning/schemas/configuration/alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
},
"condition": {
"description": "Condition can be only one of the following:",
"anyOf": [
"oneOf": [
{
"$ref": "#/$defs/conditionThreshold"
},
Expand Down Expand Up @@ -161,7 +161,7 @@
},
"threshold": {
"type": "number",
"describing": "A value against which to compare the time series"
"description": "A value against which to compare the time series"
},
"duration": {
"type": "string",
Expand Down Expand Up @@ -215,7 +215,7 @@
"properties": {
"number": {
"type": "string",
"describing": "A phone number to text notifications"
"description": "A phone number to text notifications"
}
}
}
Expand Down
66 changes: 35 additions & 31 deletions provisioning/schemas/configuration/dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"$defs": {
"dashboard": {
"type": "object",
"description": "Monitoring dashboard properties",
"description": "Monitoring dashboard properties using GridLayout (https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards#gridlayout)",
"required": [
"name",
"display-name",
Expand All @@ -44,7 +44,7 @@
},
"widgets": {
"type": "array",
"description": "A collection of dashboard's widgets",
"description": "A collection of GridLayout widgets",
"items": {
"$ref": "#/$defs/widget"
}
Expand All @@ -53,7 +53,7 @@
},
"widget": {
"type": "object",
"description": "A chart that displays data on a 2D (X and Y axes) plane (https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards#xychart)",
"description": "A widget chart that displays data on a 2D (X and Y axes) plane (https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards#xychart)",
"required": [
"datasets"
],
Expand Down Expand Up @@ -95,34 +95,38 @@
],
"properties": {
"filter": {
"query": {
"type": "string",
"description": "Identifies the metric types, resources, and projects to query"
},
"alignment": {
"enum": [
"ALIGN_NONE",
"ALIGN_DELTA",
"ALIGN_RATE",
"ALIGN_INTERPOLATE",
"ALIGN_NEXT_OLDER",
"ALIGN_MIN",
"ALIGN_MAX",
"ALIGN_MEAN",
"ALIGN_COUNT",
"ALIGN_SUM",
"ALIGN_STDDEV",
"ALIGN_COUNT_TRUE",
"ALIGN_COUNT_FALSE",
"ALIGN_FRACTION_TRUE",
"ALIGN_PERCENTILE_99",
"ALIGN_PERCENTILE_95",
"ALIGN_PERCENTILE_50",
"ALIGN_PERCENTILE_05",
"ALIGN_PERCENT_CHANGE"
],
"description": "Mathematical method to group data points together into a single time series",
"default": "ALIGN_MEAN"
"type": "object",
"description": "A set of parameters for querying time series data",
"properties": {
"query": {
"type": "string",
"description": "Identifies the metric types, resources, and projects to query"
},
"alignment": {
"enum": [
"ALIGN_NONE",
"ALIGN_DELTA",
"ALIGN_RATE",
"ALIGN_INTERPOLATE",
"ALIGN_NEXT_OLDER",
"ALIGN_MIN",
"ALIGN_MAX",
"ALIGN_MEAN",
"ALIGN_COUNT",
"ALIGN_SUM",
"ALIGN_STDDEV",
"ALIGN_COUNT_TRUE",
"ALIGN_COUNT_FALSE",
"ALIGN_FRACTION_TRUE",
"ALIGN_PERCENTILE_99",
"ALIGN_PERCENTILE_95",
"ALIGN_PERCENTILE_50",
"ALIGN_PERCENTILE_05",
"ALIGN_PERCENT_CHANGE"
],
"description": "Mathematical method to group data points together into a single time series",
"default": "ALIGN_MEAN"
}
}
},
"unit-override": {
Expand Down
21 changes: 14 additions & 7 deletions provisioning/schemas/configuration/healthchecks.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,8 @@
]
},
"labels": {
"type": "object",
"description": "Values for all of the labels listed in the associated monitored resource descriptor",
"patternProperties": {
"^[a-z0-9_\\-]+$": {
"required": true,
"type": "string"
}
}
"$ref": "#/$defs/labels"
}
}
},
Expand Down Expand Up @@ -147,6 +141,19 @@
}
}
},
"labels": {
"type": "object",
"description": "",
"patternProperties": {
"^[a-zA-Z][a-zA-Z0-9_\\-]*$": {
"type": "string",
"minLength": 0,
"maxLength": 63
}
},
"minProperties": 0,
"maxProperties": 64
},
"tcpCheck": {
"type": "object",
"description": "Information involved in a TCP Uptime check request",
Expand Down
4 changes: 2 additions & 2 deletions provisioning/schemas/configuration/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"required": [
"app-id",
"version",
"log-based-metrics"
"metrics"
],
"properties": {
"app-id": {
Expand All @@ -20,7 +20,7 @@
"type": "array",
"description": "A collection of log-based metric",
"items": {
"$ref": "#/$defs/log-based-metric"
"$ref": "#/$defs/metric"
}
}
},
Expand Down
7 changes: 2 additions & 5 deletions provisioning/schemas/configuration/services.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@
"patternProperties": {
"^[a-zA-Z][a-zA-Z0-9_\\-]*$": {
"type": "string",
"additionalProperties": {
"type": "string",
"minLength": 0,
"maxLength": 63
}
"minLength": 0,
"maxLength": 63
}
},
"minProperties": 0,
Expand Down
32 changes: 18 additions & 14 deletions provisioning/schemas/configuration/slos.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"sli": {
"description": "The definition of good service, used to measure and calculate the quality of the Service's performance with respect to a single aspect of service quality",
"anyOf": [
"oneOf": [
{
"$ref": "#/$defs/basicSLI"
},
Expand All @@ -89,23 +89,27 @@
},
"basicSLI": {
"description": "Basic SLI on a well-known service type",
"anyOf": [
"oneOf": [
{
"availability": {
"const": true,
"description": "Good service is defined to be the count of requests made to this service that return successfully"
"type": "object",
"description": "Good service is defined to be the count of requests made to this service that return successfully",
"properties": {
"availability": {
"const": true
}
}
},
{
"latency": {
"type": "object",
"description": "Good service is defined to be the count of requests made to this service that are fast enough with respect to `latency.threshold`",
"properties": {
"threshold": {
"type": "string",
"required": true,
"pattern": "^[0-9]+s$"
}
"type": "object",
"description": "Good service is defined to be the count of requests made to this service that are fast enough with respect to `latency.threshold`",
"required": [
"threshold"
],
"properties": {
"threshold": {
"type": "string",
"description": "A duration string, e.g. 10s. Good service is defined to be the count of requests made to this service that return in no more than threshold.",
"pattern": "^[0-9]+s$"
}
}
}
Expand Down

0 comments on commit e1b4c67

Please sign in to comment.