master
json 296 lines 5.94 KB
Raw
1 {
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "go.d chart template spec v1",
4 "type": "object",
5 "additionalProperties": false,
6 "required": [
7 "version",
8 "groups"
9 ],
10 "properties": {
11 "version": {
12 "type": "string",
13 "const": "v1"
14 },
15 "context_namespace": {
16 "type": "string"
17 },
18 "engine": {
19 "$ref": "#/$defs/engine"
20 },
21 "groups": {
22 "type": "array",
23 "minItems": 1,
24 "items": {
25 "$ref": "#/$defs/group"
26 }
27 }
28 },
29 "$defs": {
30 "selector_expr": {
31 "type": "object",
32 "additionalProperties": false,
33 "properties": {
34 "allow": {
35 "type": "array",
36 "items": {
37 "type": "string",
38 "minLength": 1
39 }
40 },
41 "deny": {
42 "type": "array",
43 "items": {
44 "type": "string",
45 "minLength": 1
46 }
47 }
48 }
49 },
50 "engine_autogen": {
51 "type": "object",
52 "additionalProperties": false,
53 "properties": {
54 "enabled": {
55 "type": "boolean"
56 },
57 "max_type_id_len": {
58 "oneOf": [
59 {
60 "const": 0
61 },
62 {
63 "type": "integer",
64 "minimum": 4
65 }
66 ]
67 },
68 "expire_after_success_cycles": {
69 "type": "integer",
70 "minimum": 0
71 }
72 }
73 },
74 "engine": {
75 "type": "object",
76 "additionalProperties": false,
77 "properties": {
78 "selector": {
79 "$ref": "#/$defs/selector_expr"
80 },
81 "autogen": {
82 "$ref": "#/$defs/engine_autogen"
83 }
84 }
85 },
86 "group": {
87 "type": "object",
88 "additionalProperties": false,
89 "required": [
90 "family"
91 ],
92 "properties": {
93 "family": {
94 "type": "string",
95 "minLength": 1
96 },
97 "context_namespace": {
98 "type": "string"
99 },
100 "metrics": {
101 "type": "array",
102 "items": {
103 "type": "string"
104 }
105 },
106 "chart_defaults": {
107 "$ref": "#/$defs/chart_defaults"
108 },
109 "groups": {
110 "type": "array",
111 "items": {
112 "$ref": "#/$defs/group"
113 }
114 },
115 "charts": {
116 "type": "array",
117 "items": {
118 "$ref": "#/$defs/chart"
119 }
120 }
121 }
122 },
123 "chart": {
124 "type": "object",
125 "additionalProperties": false,
126 "required": [
127 "title",
128 "context",
129 "units",
130 "dimensions"
131 ],
132 "properties": {
133 "id": {
134 "type": "string"
135 },
136 "title": {
137 "type": "string",
138 "minLength": 1
139 },
140 "family": {
141 "type": "string"
142 },
143 "context": {
144 "type": "string",
145 "minLength": 1
146 },
147 "units": {
148 "type": "string",
149 "minLength": 1
150 },
151 "algorithm": {
152 "type": "string",
153 "enum": [
154 "absolute",
155 "incremental"
156 ]
157 },
158 "type": {
159 "type": "string",
160 "enum": [
161 "line",
162 "area",
163 "stacked",
164 "heatmap"
165 ]
166 },
167 "priority": {
168 "type": "integer"
169 },
170 "label_promotion": {
171 "type": "array",
172 "items": {
173 "type": "string",
174 "pattern": "\\S"
175 }
176 },
177 "instances": {
178 "$ref": "#/$defs/instances"
179 },
180 "lifecycle": {
181 "$ref": "#/$defs/lifecycle"
182 },
183 "dimensions": {
184 "type": "array",
185 "minItems": 1,
186 "items": {
187 "$ref": "#/$defs/dimension"
188 }
189 }
190 }
191 },
192 "chart_defaults": {
193 "type": "object",
194 "additionalProperties": false,
195 "properties": {
196 "label_promotion": {
197 "type": "array",
198 "items": {
199 "type": "string",
200 "pattern": "\\S"
201 }
202 },
203 "instances": {
204 "$ref": "#/$defs/instances"
205 }
206 }
207 },
208 "instances": {
209 "type": "object",
210 "additionalProperties": false,
211 "required": [
212 "by_labels"
213 ],
214 "properties": {
215 "by_labels": {
216 "type": "array",
217 "minItems": 1,
218 "items": {
219 "type": "string"
220 }
221 }
222 }
223 },
224 "lifecycle": {
225 "type": "object",
226 "additionalProperties": false,
227 "properties": {
228 "max_instances": {
229 "type": "integer",
230 "minimum": 0
231 },
232 "expire_after_cycles": {
233 "type": "integer",
234 "minimum": 0
235 },
236 "dimensions": {
237 "$ref": "#/$defs/dimension_lifecycle"
238 }
239 }
240 },
241 "dimension_lifecycle": {
242 "type": "object",
243 "additionalProperties": false,
244 "properties": {
245 "max_dims": {
246 "type": "integer",
247 "minimum": 0
248 },
249 "expire_after_cycles": {
250 "type": "integer",
251 "minimum": 0
252 }
253 }
254 },
255 "dimension": {
256 "type": "object",
257 "additionalProperties": false,
258 "required": [
259 "selector"
260 ],
261 "properties": {
262 "selector": {
263 "type": "string",
264 "minLength": 1
265 },
266 "name": {
267 "type": "string"
268 },
269 "name_from_label": {
270 "type": "string"
271 },
272 "options": {
273 "$ref": "#/$defs/dimension_options"
274 }
275 }
276 },
277 "dimension_options": {
278 "type": "object",
279 "additionalProperties": false,
280 "properties": {
281 "multiplier": {
282 "type": "integer"
283 },
284 "divisor": {
285 "type": "integer"
286 },
287 "hidden": {
288 "type": "boolean"
289 },
290 "float": {
291 "type": "boolean"
292 }
293 }
294 }
295 }
296 }