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

Commit e1b4c67

Browse files
committed
chore: fix schema for services
1 parent 165c600 commit e1b4c67

File tree

6 files changed

+74
-62
lines changed

6 files changed

+74
-62
lines changed

provisioning/schemas/configuration/alerts.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
},
130130
"condition": {
131131
"description": "Condition can be only one of the following:",
132-
"anyOf": [
132+
"oneOf": [
133133
{
134134
"$ref": "#/$defs/conditionThreshold"
135135
},
@@ -161,7 +161,7 @@
161161
},
162162
"threshold": {
163163
"type": "number",
164-
"describing": "A value against which to compare the time series"
164+
"description": "A value against which to compare the time series"
165165
},
166166
"duration": {
167167
"type": "string",
@@ -215,7 +215,7 @@
215215
"properties": {
216216
"number": {
217217
"type": "string",
218-
"describing": "A phone number to text notifications"
218+
"description": "A phone number to text notifications"
219219
}
220220
}
221221
}

provisioning/schemas/configuration/dashboards.json

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"$defs": {
2828
"dashboard": {
2929
"type": "object",
30-
"description": "Monitoring dashboard properties",
30+
"description": "Monitoring dashboard properties using GridLayout (https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards#gridlayout)",
3131
"required": [
3232
"name",
3333
"display-name",
@@ -44,7 +44,7 @@
4444
},
4545
"widgets": {
4646
"type": "array",
47-
"description": "A collection of dashboard's widgets",
47+
"description": "A collection of GridLayout widgets",
4848
"items": {
4949
"$ref": "#/$defs/widget"
5050
}
@@ -53,7 +53,7 @@
5353
},
5454
"widget": {
5555
"type": "object",
56-
"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)",
56+
"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)",
5757
"required": [
5858
"datasets"
5959
],
@@ -95,34 +95,38 @@
9595
],
9696
"properties": {
9797
"filter": {
98-
"query": {
99-
"type": "string",
100-
"description": "Identifies the metric types, resources, and projects to query"
101-
},
102-
"alignment": {
103-
"enum": [
104-
"ALIGN_NONE",
105-
"ALIGN_DELTA",
106-
"ALIGN_RATE",
107-
"ALIGN_INTERPOLATE",
108-
"ALIGN_NEXT_OLDER",
109-
"ALIGN_MIN",
110-
"ALIGN_MAX",
111-
"ALIGN_MEAN",
112-
"ALIGN_COUNT",
113-
"ALIGN_SUM",
114-
"ALIGN_STDDEV",
115-
"ALIGN_COUNT_TRUE",
116-
"ALIGN_COUNT_FALSE",
117-
"ALIGN_FRACTION_TRUE",
118-
"ALIGN_PERCENTILE_99",
119-
"ALIGN_PERCENTILE_95",
120-
"ALIGN_PERCENTILE_50",
121-
"ALIGN_PERCENTILE_05",
122-
"ALIGN_PERCENT_CHANGE"
123-
],
124-
"description": "Mathematical method to group data points together into a single time series",
125-
"default": "ALIGN_MEAN"
98+
"type": "object",
99+
"description": "A set of parameters for querying time series data",
100+
"properties": {
101+
"query": {
102+
"type": "string",
103+
"description": "Identifies the metric types, resources, and projects to query"
104+
},
105+
"alignment": {
106+
"enum": [
107+
"ALIGN_NONE",
108+
"ALIGN_DELTA",
109+
"ALIGN_RATE",
110+
"ALIGN_INTERPOLATE",
111+
"ALIGN_NEXT_OLDER",
112+
"ALIGN_MIN",
113+
"ALIGN_MAX",
114+
"ALIGN_MEAN",
115+
"ALIGN_COUNT",
116+
"ALIGN_SUM",
117+
"ALIGN_STDDEV",
118+
"ALIGN_COUNT_TRUE",
119+
"ALIGN_COUNT_FALSE",
120+
"ALIGN_FRACTION_TRUE",
121+
"ALIGN_PERCENTILE_99",
122+
"ALIGN_PERCENTILE_95",
123+
"ALIGN_PERCENTILE_50",
124+
"ALIGN_PERCENTILE_05",
125+
"ALIGN_PERCENT_CHANGE"
126+
],
127+
"description": "Mathematical method to group data points together into a single time series",
128+
"default": "ALIGN_MEAN"
129+
}
126130
}
127131
},
128132
"unit-override": {

provisioning/schemas/configuration/healthchecks.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,8 @@
9595
]
9696
},
9797
"labels": {
98-
"type": "object",
9998
"description": "Values for all of the labels listed in the associated monitored resource descriptor",
100-
"patternProperties": {
101-
"^[a-z0-9_\\-]+$": {
102-
"required": true,
103-
"type": "string"
104-
}
105-
}
99+
"$ref": "#/$defs/labels"
106100
}
107101
}
108102
},
@@ -147,6 +141,19 @@
147141
}
148142
}
149143
},
144+
"labels": {
145+
"type": "object",
146+
"description": "",
147+
"patternProperties": {
148+
"^[a-zA-Z][a-zA-Z0-9_\\-]*$": {
149+
"type": "string",
150+
"minLength": 0,
151+
"maxLength": 63
152+
}
153+
},
154+
"minProperties": 0,
155+
"maxProperties": 64
156+
},
150157
"tcpCheck": {
151158
"type": "object",
152159
"description": "Information involved in a TCP Uptime check request",

provisioning/schemas/configuration/metrics.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"required": [
66
"app-id",
77
"version",
8-
"log-based-metrics"
8+
"metrics"
99
],
1010
"properties": {
1111
"app-id": {
@@ -20,7 +20,7 @@
2020
"type": "array",
2121
"description": "A collection of log-based metric",
2222
"items": {
23-
"$ref": "#/$defs/log-based-metric"
23+
"$ref": "#/$defs/metric"
2424
}
2525
}
2626
},

provisioning/schemas/configuration/services.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,8 @@
7575
"patternProperties": {
7676
"^[a-zA-Z][a-zA-Z0-9_\\-]*$": {
7777
"type": "string",
78-
"additionalProperties": {
79-
"type": "string",
80-
"minLength": 0,
81-
"maxLength": 63
82-
}
78+
"minLength": 0,
79+
"maxLength": 63
8380
}
8481
},
8582
"minProperties": 0,

provisioning/schemas/configuration/slos.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
},
7777
"sli": {
7878
"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",
79-
"anyOf": [
79+
"oneOf": [
8080
{
8181
"$ref": "#/$defs/basicSLI"
8282
},
@@ -89,23 +89,27 @@
8989
},
9090
"basicSLI": {
9191
"description": "Basic SLI on a well-known service type",
92-
"anyOf": [
92+
"oneOf": [
9393
{
94-
"availability": {
95-
"const": true,
96-
"description": "Good service is defined to be the count of requests made to this service that return successfully"
94+
"type": "object",
95+
"description": "Good service is defined to be the count of requests made to this service that return successfully",
96+
"properties": {
97+
"availability": {
98+
"const": true
99+
}
97100
}
98101
},
99102
{
100-
"latency": {
101-
"type": "object",
102-
"description": "Good service is defined to be the count of requests made to this service that are fast enough with respect to `latency.threshold`",
103-
"properties": {
104-
"threshold": {
105-
"type": "string",
106-
"required": true,
107-
"pattern": "^[0-9]+s$"
108-
}
103+
"type": "object",
104+
"description": "Good service is defined to be the count of requests made to this service that are fast enough with respect to `latency.threshold`",
105+
"required": [
106+
"threshold"
107+
],
108+
"properties": {
109+
"threshold": {
110+
"type": "string",
111+
"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.",
112+
"pattern": "^[0-9]+s$"
109113
}
110114
}
111115
}

0 commit comments

Comments
 (0)