@cryptotaxi247 / netdata-1 / commits / 606e9e753

simplify collector schema by moving some props under meta (#15372)

Ilya Mashchenko committed Jul 12, 2023 at 19:43 UTC 606e9e7538697151723dc661e7cdd8cd3ab29564
3 files changed +143 -159
collectors/metadata/schemas/definitions.json
+31
@@ -1,5 +1,36 @@
1 {
2 "definitions": {
3 + "monitored_instance": {
4 + "type": "object",
5 + "description": "Information about the monitored instance (metrics source).",
6 + "properties": {
7 + "name": {
8 + "description": "Metrics source name (e.g. VerneMQ, Network interfaces, Files and directories). Use official spelling for applications.",
9 + "type": "string"
10 + },
11 + "link": {
12 + "description": "Link to the monitored instance official website if any.",
13 + "type": "string"
14 + },
15 + "categories": {
16 + "type": "array",
17 + "description": "Categories this integration falls into.",
18 + "items": {
19 + "$ref": "#/definitions/category"
20 + }
21 + },
22 + "icon_path": {
23 + "type": "string",
24 + "description": "Path to the integration's icon."
25 + }
26 + },
27 + "required": [
28 + "name",
29 + "link",
30 + "categories",
31 + "icon_path"
32 + ]
33 + },
34 "category": {
35 "type": "object",
36 "description": "Category and subcategory of the collector/monitored instance.",
collectors/metadata/schemas/single-module.json
+88 -134
@@ -3,61 +3,95 @@
3 "type": "object",
4 "title": "Netdata collector single module meta",
5 "properties": {
6 - "plugin_name": {
7 - "type": "string",
8 - "description": "Plugin name (e.g. apps.plugin, proc.plugin, go.d.plugin). It must match the name of the executable file in the plugins.d directory."
9 - },
10 - "module_name": {
11 - "type": "string",
12 - "description": "Module name (e.g. apache, /proc/stat, httpcheck). It usually has the same name as the module configuration file (external plugin) or the section name in netdata.conf (internal plugin)."
13 - },
14 - "categories": {
15 - "type": "array",
16 - "description": "An array defining the categories the integration falls into.",
17 - "items": {
18 - "$ref": "./definitions.json#/definitions/category"
19 - }
20 - },
21 - "icon_path": {
22 - "type": "string",
23 - "description": "path to the integration's icon"
24 - },
25 - "monitored_instance": {
26 - "$ref": "#/$defs/_monitored_instance"
27 - },
28 - "alternative_monitored_instances": {
29 - "type": "array",
30 - "items": {
31 - "type": "object",
32 - "properties": {
33 - "monitored_instance": {
34 - "$ref": "#/$defs/_monitored_instance"
35 - },
36 - "categories": {
37 - "type": "array",
38 - "description": "An array defining the categories the integration falls into.",
39 - "items": {
40 - "$ref": "./definitions.json#/definitions/category"
6 + "meta": {
7 + "type": "object",
8 + "properties": {
9 + "plugin_name": {
10 + "type": "string",
11 + "description": "Plugin name (e.g. apps.plugin, proc.plugin, go.d.plugin). It must match the name of the executable file in the plugins.d directory."
12 + },
13 + "module_name": {
14 + "type": "string",
15 + "description": "Module name (e.g. apache, /proc/stat, httpcheck). It usually has the same name as the module configuration file (external plugin) or the section name in netdata.conf (internal plugin)."
16 + },
17 + "monitored_instance": {
18 + "$ref": "./definitions.json#/definitions/monitored_instance"
19 + },
20 + "alternative_monitored_instances": {
21 + "type": "array",
22 + "items": {
23 + "$ref": "./definitions.json#/definitions/monitored_instance"
24 + }
25 + },
26 + "keywords": {
27 + "type": "array",
28 + "description": "An array of terms related to the integration.",
29 + "items": {
30 + "type": "string"
31 + }
32 + },
33 + "related_resources": {
34 + "type": "object",
35 + "description": "Available related resources for the monitored instance.",
36 + "properties": {
37 + "integrations": {
38 + "type": "object",
39 + "description": "All collectors that provide additional metrics for the monitored instance. This may include generic collectors, e.g. 'httpcheck' for web servers to monitor specific endpoints.",
40 + "properties": {
41 + "list": {
42 + "type": "array",
43 + "description": "List of related integrations.",
44 + "items": {
45 + "type": "object",
46 + "properties": {
47 + "plugin_name": {
48 + "type": "string",
49 + "description": "Related integration plugin name."
50 + },
51 + "module_name": {
52 + "type": "string",
53 + "description": "Related integration module name."
54 + }
55 + },
56 + "required": [
57 + "plugin_name",
58 + "module_name"
59 + ]
60 + }
61 + }
62 + },
63 + "required": [
64 + "list"
65 + ]
66 }
67 },
43 - "icon_path": {
44 - "type": "string",
45 - "description": "path to the integration's icon"
46 - }
68 + "required": [
69 + "integrations"
70 + ]
71 },
48 - "required": [
49 - "monitored_instance",
50 - "icon_path",
51 - "categories"
52 - ]
53 - }
54 - },
55 - "keywords": {
56 - "type": "array",
57 - "description": "An array of terms related to the integration.",
58 - "items": {
59 - "type": "string"
60 - }
72 + "info_provided_to_referring_integrations": {
73 + "type": "object",
74 + "description": "Information that this collector can provide about itself when other integrations mention it. This text will not be appear on this collector's page.",
75 + "properties": {
76 + "description": {
77 + "type": "string",
78 + "description": "TODO"
79 + }
80 + },
81 + "required": [
82 + "description"
83 + ]
84 + }
85 + },
86 + "required": [
87 + "plugin_name",
88 + "module_name",
89 + "monitored_instance",
90 + "alternative_monitored_instances",
91 + "keywords",
92 + "related_resources",
93 + "info_provided_to_referring_integrations"
94 + ]
95 },
96 "overview": {
97 "type": "object",
@@ -380,58 +414,6 @@
414 "problems"
415 ]
416 },
383 - "related_resources": {
384 - "type": "object",
385 - "description": "Available related resources for the monitored instance.",
386 - "properties": {
387 - "integrations": {
388 - "type": "object",
389 - "description": "All collectors that provide additional metrics for the monitored instance. This may include generic collectors, e.g. 'httpcheck' for web servers to monitor specific endpoints.",
390 - "properties": {
391 - "list": {
392 - "type": "array",
393 - "description": "List of related integrations.",
394 - "items": {
395 - "type": "object",
396 - "properties": {
397 - "plugin_name": {
398 - "type": "string",
399 - "description": "Related integration plugin name."
400 - },
401 - "module_name": {
402 - "type": "string",
403 - "description": "Related integration module name."
404 - }
405 - },
406 - "required": [
407 - "plugin_name",
408 - "module_name"
409 - ]
410 - }
411 - }
412 - },
413 - "required": [
414 - "list"
415 - ]
416 - }
417 - },
418 - "required": [
419 - "integrations"
420 - ]
421 - },
422 - "info_provided_to_referring_integrations": {
423 - "type": "object",
424 - "description": "Information that this collector can provide about itself when other integrations mention it. This text will not be appear on this collector's page.",
425 - "properties": {
426 - "description": {
427 - "type": "string",
428 - "description": "TODO"
429 - }
430 - },
431 - "required": [
432 - "description"
433 - ]
434 - },
417 "alerts": {
418 "$ref": "./definitions.json#/definitions/alerts"
419 },
@@ -440,39 +422,11 @@
422 }
423 },
424 "required": [
443 - "plugin_name",
444 - "module_name",
445 - "categories",
446 - "icon_path",
447 - "monitored_instance",
448 - "alternative_monitored_instances",
449 - "keywords",
425 + "meta",
426 "overview",
427 "setup",
428 "troubleshooting",
453 - "related_resources",
454 - "info_provided_to_referring_integrations",
429 "alerts",
430 "metrics"
457 - ],
458 - "$defs": {
459 - "_monitored_instance": {
460 - "type": "object",
461 - "description": "Information about the monitored instance (metrics source).",
462 - "properties": {
463 - "name": {
464 - "description": "Metrics source name (e.g. VerneMQ, Network interfaces, Files and directories). Use official spelling for applications.",
465 - "type": "string"
466 - },
467 - "link": {
468 - "description": "Link to the monitored instance official website if any.",
469 - "type": "string"
470 - }
471 - },
472 - "required": [
473 - "name",
474 - "link"
475 - ]
476 - }
477 - }
431 + ]
432 }
collectors/metadata/single-module-template.yaml
+24 -25
@@ -1,22 +1,29 @@
1 -plugin_name: ""
2 -module_name: ""
3 -monitored_instance:
4 - name: ""
5 - link: ""
6 -alternative_monitored_instances:
7 - - monitored_instance:
8 - name: ""
9 - link: ""
1 +meta:
2 + plugin_name: ""
3 + module_name: ""
4 + monitored_instance:
5 + name: ""
6 + link: ""
7 + icon_path: ""
8 categories:
9 - level0: data-collection
12 - level1: containers-and-vms
13 - icon_path: ""
14 -keywords:
15 - - ""
16 -categories:
17 - - level0: data-collection
18 - level1: databases
19 -icon_path: ""
10 + level1: databases
11 + alternative_monitored_instances:
12 + - name: ""
13 + link: ""
14 + icon_path: ""
15 + categories:
16 + - level0: data-collection
17 + level1: containers-and-vms
18 + related_resources:
19 + integrations:
20 + list:
21 + - plugin_name: ""
22 + module_name: ""
23 + info_provided_to_referring_integrations:
24 + description: ""
25 + keywords:
26 + - ""
27 overview:
28 data_collection:
29 metrics_description: ""
@@ -66,13 +73,6 @@ troubleshooting:
73 list:
74 - name: ""
75 description: ""
69 -related_resources:
70 - integrations:
71 - list:
72 - - plugin_name: ""
73 - module_name: ""
74 -info_provided_to_referring_integrations:
75 - description: ""
76 alerts:
77 - info: ""
78 link: ""
@@ -101,4 +101,3 @@ metrics:
101 chart_type: ""
102 dimensions:
103 - name: ""
104 -