Single module schema, add required properties (#15326)
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Fotis Voutsas committed
Jul 7, 2023 at 17:08 UTC
933baaf4f90c51c4bfb658129edee115bcfe05d5
2 files changed
+181
-34
collectors/metadata/schemas/single-module.json
+179
-33
@@ -21,10 +21,10 @@
21
}
22
},
23
"keywords": {
24
- "type":"array",
24
+ "type": "array",
25
"description": "An array of terms related to the integration.",
26
"items": {
27
- "type":"string"
27
+ "type": "string"
28
}
29
},
30
"overview": {
@@ -42,7 +42,11 @@
42
"type": "string",
43
"description": "Description of how metrics are collected (e.g. HTTP requests, establish a TCP connection and send a command, a specific binary execution). A suggested approach here is to provide a detailed description of how the collector gathers metrics: how many connections are established, exact requests/commands executed, exact endpoints used."
44
}
45
- }
45
+ },
46
+ "required": [
47
+ "metrics_description",
48
+ "method_description"
49
+ ]
50
},
51
"supported_platforms": {
52
"type": "object",
@@ -62,7 +66,11 @@
66
"type": "string"
67
}
68
}
65
- }
69
+ },
70
+ "required": [
71
+ "include",
72
+ "exclude"
73
+ ]
74
},
75
"multi-instance": {
76
"type": "boolean",
@@ -75,7 +83,10 @@
83
"description": {
84
"type": "string"
85
}
78
- }
86
+ },
87
+ "required": [
88
+ "description"
89
+ ]
90
},
91
"default_behavior": {
92
"type": "object",
@@ -88,7 +99,10 @@
99
"description": {
100
"type": "string"
101
}
91
- }
102
+ },
103
+ "required": [
104
+ "description"
105
+ ]
106
},
107
"limits": {
108
"type": "object",
@@ -97,7 +111,10 @@
111
"description": {
112
"type": "string"
113
}
100
- }
114
+ },
115
+ "required": [
116
+ "description"
117
+ ]
118
},
119
"performance_impact": {
120
"type": "object",
@@ -106,11 +123,26 @@
123
"description": {
124
"type": "string"
125
}
109
- }
126
+ },
127
+ "required": [
128
+ "description"
129
+ ]
130
}
111
- }
131
+ },
132
+ "required": [
133
+ "auto_detection",
134
+ "limits",
135
+ "performance_impact"
136
+ ]
137
}
113
- }
138
+ },
139
+ "required": [
140
+ "data_collection",
141
+ "supported_platforms",
142
+ "multi-instance",
143
+ "additional_permissions",
144
+ "default_behavior"
145
+ ]
146
},
147
"setup": {
148
"type": "object",
@@ -134,7 +166,11 @@
166
"type": "string",
167
"description": "Steps to follow to meet this prerequisite."
168
}
137
- }
169
+ },
170
+ "required": [
171
+ "title",
172
+ "description"
173
+ ]
174
}
175
}
176
}
@@ -155,7 +191,10 @@
191
"type": "string",
192
"description": "The name of the section in the configuration file. Only for data collectors whose configuration is in netdata.conf (e.g. proc.plugin modules)."
193
}
158
- }
194
+ },
195
+ "required": [
196
+ "name"
197
+ ]
198
},
199
"options": {
200
"type": "object",
@@ -197,10 +236,21 @@
236
"type": "boolean",
237
"description": "Indicates whether this option is required or not. The option is required if the collector does not work, if it is not set."
238
}
200
- }
239
+ },
240
+ "required": [
241
+ "name",
242
+ "description",
243
+ "default_value",
244
+ "required"
245
+ ]
246
}
247
}
203
- }
248
+ },
249
+ "required": [
250
+ "description",
251
+ "folding",
252
+ "list"
253
+ ]
254
},
255
"examples": {
256
"type": "object",
@@ -227,14 +277,32 @@
277
"type": "string",
278
"description": "Example configuration."
279
}
230
- }
280
+ },
281
+ "required": [
282
+ "folding",
283
+ "name",
284
+ "description",
285
+ "config"
286
+ ]
287
}
288
}
233
- }
289
+ },
290
+ "required": [
291
+ "list"
292
+ ]
293
}
235
- }
294
+ },
295
+ "required": [
296
+ "file",
297
+ "options",
298
+ "examples"
299
+ ]
300
}
237
- }
301
+ },
302
+ "required": [
303
+ "prerequisites",
304
+ "configuration"
305
+ ]
306
},
307
"troubleshooting": {
308
"type": "object",
@@ -259,11 +327,21 @@
327
"description": "Explanation of the problem and its solution."
328
}
329
}
262
- }
330
+ },
331
+ "required": [
332
+ "name",
333
+ "description"
334
+ ]
335
}
264
- }
336
+ },
337
+ "required": [
338
+ "list"
339
+ ]
340
}
266
- }
341
+ },
342
+ "required": [
343
+ "problems"
344
+ ]
345
},
346
"related_resources": {
347
"type": "object",
@@ -287,12 +365,22 @@
365
"type": "string",
366
"description": "Related integration module name."
367
}
290
- }
368
+ },
369
+ "required": [
370
+ "plugin_name",
371
+ "module_name"
372
+ ]
373
}
374
}
293
- }
375
+ },
376
+ "required": [
377
+ "list"
378
+ ]
379
}
295
- }
380
+ },
381
+ "required": [
382
+ "integrations"
383
+ ]
384
},
385
"info_provided_to_referring_integrations": {
386
"type": "object",
@@ -302,7 +390,10 @@
390
"type": "string",
391
"description": "TODO"
392
}
305
- }
393
+ },
394
+ "required": [
395
+ "description"
396
+ ]
397
},
398
"alerts": {
399
"type": "array",
@@ -331,7 +422,13 @@
422
"type": "string",
423
"description": "Alert's 'os' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-os)."
424
}
334
- }
425
+ },
426
+ "required": [
427
+ "name",
428
+ "link",
429
+ "metric",
430
+ "info"
431
+ ]
432
}
433
},
434
"metrics": {
@@ -381,7 +478,11 @@
478
"type": "string",
479
"description": "Label description."
480
}
384
- }
481
+ },
482
+ "required": [
483
+ "name",
484
+ "description"
485
+ ]
486
}
487
},
488
"metrics": {
@@ -424,18 +525,55 @@
525
"type": "string",
526
"description": "Dimension name."
527
}
427
- }
528
+ },
529
+ "required": [
530
+ "name"
531
+ ]
532
}
533
}
430
- }
534
+ },
535
+ "required": [
536
+ "name",
537
+ "availability",
538
+ "description",
539
+ "unit",
540
+ "chart_type",
541
+ "dimensions"
542
+ ]
543
}
544
}
433
- }
545
+ },
546
+ "required": [
547
+ "name",
548
+ "description",
549
+ "labels",
550
+ "metrics"
551
+ ]
552
}
553
}
436
- }
554
+ },
555
+ "required": [
556
+ "folding",
557
+ "description",
558
+ "availability",
559
+ "scopes"
560
+ ]
561
}
562
},
563
+ "required": [
564
+ "plugin_name",
565
+ "module_name",
566
+ "monitored_instance",
567
+ "alternative_monitored_instances",
568
+ "keywords",
569
+ "overview",
570
+ "setup",
571
+ "troubleshooting",
572
+ "related_resources",
573
+ "info_provided_to_referring_integrations",
574
+ "alerts",
575
+ "metrics"
576
+ ],
577
"$defs": {
578
"_monitored_instance": {
579
"type": "object",
@@ -449,7 +587,11 @@
587
"description": "Link to the monitored instance official website if any.",
588
"type": "string"
589
}
452
- }
590
+ },
591
+ "required": [
592
+ "name",
593
+ "link"
594
+ ]
595
},
596
"_folding": {
597
"type": "object",
@@ -463,7 +605,11 @@
605
"description": "Determines if this content should be folded",
606
"type": "boolean"
607
}
466
- }
608
+ },
609
+ "required": [
610
+ "title",
611
+ "enabled"
612
+ ]
613
}
614
}
615
}
collectors/metadata/single-module-template.yaml
+2
-1
@@ -32,6 +32,7 @@ setup:
32
description: ""
33
configuration:
34
file:
35
+ name: ""
36
description: ""
37
options:
38
description: ""
@@ -46,7 +47,7 @@ setup:
47
examples:
48
list:
49
- name: ""
49
- folding:
50
+ folding:
51
enabled: true
52
title: ""
53
description: ""