Browse Source

Add keys to integrations schema, categories, icon path, plus some fixes (#15365)

Co-authored-by: ilyam8 <ilya@netdata.cloud>
Fotis Voutsas 1 year ago
parent
commit
2ea16ed624

+ 33 - 0
collectors/metadata/schemas/definitions.json

@@ -1,5 +1,38 @@
 {
   "definitions": {
+    "category": {
+      "type": "object",
+      "description": "Category and subcategory of the collector/monitored instance.",
+      "properties": {
+        "level0": {
+          "type": "string",
+          "description": "Category name",
+          "oneOf": [
+            {
+              "enum": [
+                "data-collection"
+              ]
+            }
+          ]
+        },
+        "level1": {
+          "type": "string",
+          "description": "Subcategory name",
+          "oneOf": [
+            {
+              "enum": [
+                "databases",
+                "web-servers",
+                "message-brokers",
+                "hardware-and-sensors",
+                "operating-systems",
+                "containers-and-vms"
+              ]
+            }
+          ]
+        }
+      }
+    },
     "alerts": {
       "type": "array",
       "description": "The list of configured alerts shipped with Netdata for this collector.",

+ 39 - 3
collectors/metadata/schemas/single-module.json

@@ -11,13 +11,45 @@
       "type": "string",
       "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)."
     },
+    "categories": {
+      "type": "array",
+      "description": "An array defining the categories the integration falls into.",
+      "items": {
+        "$ref": "./definitions.json#/definitions/category"
+      }
+    },
+    "icon_path": {
+      "type": "string",
+      "description": "path to the integration's icon"
+    },
     "monitored_instance": {
       "$ref": "#/$defs/_monitored_instance"
     },
     "alternative_monitored_instances": {
       "type": "array",
       "items": {
-        "$ref": "#/$defs/_monitored_instance"
+        "type": "object",
+        "properties": {
+          "monitored_instance": {
+            "$ref": "#/$defs/_monitored_instance"
+          },
+          "categories": {
+            "type": "array",
+            "description": "An array defining the categories the integration falls into.",
+            "items": {
+              "$ref": "./definitions.json#/definitions/category"
+            }
+          },
+          "icon_path": {
+            "type": "string",
+            "description": "path to the integration's icon"
+          }
+        },
+        "required": [
+          "monitored_instance",
+          "icon_path",
+          "categories"
+        ]
       }
     },
     "keywords": {
@@ -56,14 +88,16 @@
               "type": "array",
               "description": "Only supported OS/platforms. Platforms supported by Netdata will be ignored, only those listed are considered supported.",
               "items": {
-                "type": "string"
+                "type": "string",
+                "minLength": 2
               }
             },
             "exclude": {
               "type": "array",
               "description": "Unsupported OS/platforms. The result set is all platforms supported by Netdata except for those excluded.",
               "items": {
-                "type": "string"
+                "type": "string",
+                "minLength": 2
               }
             }
           },
@@ -408,6 +442,8 @@
   "required": [
     "plugin_name",
     "module_name",
+    "categories",
+    "icon_path",
     "monitored_instance",
     "alternative_monitored_instances",
     "keywords",

+ 11 - 2
collectors/metadata/single-module-template.yaml

@@ -4,10 +4,19 @@ monitored_instance:
   name: ""
   link: ""
 alternative_monitored_instances:
-  - name: ""
-    link: ""
+  - monitored_instance:
+      name: ""
+      link: ""
+    categories:
+      - level0: data-collection
+        level1: containers-and-vms
+    icon_path: ""
 keywords:
   - ""
+categories:
+  - level0: data-collection
+    level1: databases
+icon_path: ""
 overview:
   data_collection:
     metrics_description: ""