@cryptotaxi247 / netdata-1 / commits / 7c59db6e2

move not really related props single-module.json -> definitions.json (#15366)

Ilya Mashchenko committed Jul 12, 2023 at 12:52 UTC 7c59db6e29ca37eebb25921cfcb6a668dab3d18c
2 files changed +193 -179
collectors/metadata/schemas/definitions.json new
+189
@@ -0,0 +1,189 @@
1 +{
2 + "definitions": {
3 + "alerts": {
4 + "type": "array",
5 + "description": "The list of configured alerts shipped with Netdata for this collector.",
6 + "items": {
7 + "type": "object",
8 + "description": "Information about the configured alert.",
9 + "properties": {
10 + "name": {
11 + "type": "string",
12 + "description": "Alert's 'alarm' or 'template' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-alarm-or-template)."
13 + },
14 + "link": {
15 + "type": "string",
16 + "description": "Link to github .conf file that this alert originates from"
17 + },
18 + "metric": {
19 + "type": "string",
20 + "description": "Alert's 'on' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-on)."
21 + },
22 + "info": {
23 + "type": "string",
24 + "description": "Alert's 'info' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-info)."
25 + },
26 + "os": {
27 + "type": "string",
28 + "description": "Alert's 'os' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-os)."
29 + }
30 + },
31 + "required": [
32 + "name",
33 + "link",
34 + "metric",
35 + "info"
36 + ]
37 + }
38 + },
39 + "metrics": {
40 + "type": "object",
41 + "description": "Collected metrics grouped by scope. The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.",
42 + "properties": {
43 + "folding": {
44 + "$ref": "#/definitions/folding"
45 + },
46 + "description": {
47 + "type": "string",
48 + "description": "General description of collected metrics/scopes."
49 + },
50 + "availability": {
51 + "type": "array",
52 + "description": "Metrics collection availability conditions. Some metrics are only available when certain conditions are met. For example, Apache exposes additional metrics when Extended status is configured, Consul exposes different set of metrics depends on its mode. This field should list the available conditions that will later be matched for each of the metrics.",
53 + "items": {
54 + "type": "string",
55 + "description": "Availability condition name."
56 + }
57 + },
58 + "scopes": {
59 + "type": "array",
60 + "description": "List of scopes and their metrics.",
61 + "items": {
62 + "type": "object",
63 + "properties": {
64 + "name": {
65 + "type": "string",
66 + "description": "Scope name."
67 + },
68 + "description": {
69 + "type": "string",
70 + "description": "Scope description."
71 + },
72 + "labels": {
73 + "type": "array",
74 + "description": "Label set of the scope.",
75 + "items": {
76 + "type": "object",
77 + "properties": {
78 + "name": {
79 + "type": "string",
80 + "description": "Label name."
81 + },
82 + "description": {
83 + "type": "string",
84 + "description": "Label description."
85 + }
86 + },
87 + "required": [
88 + "name",
89 + "description"
90 + ]
91 + }
92 + },
93 + "metrics": {
94 + "type": "array",
95 + "description": "List of collected metrics (chart contexts) in the scope.",
96 + "items": {
97 + "type": "object",
98 + "properties": {
99 + "name": {
100 + "type": "string",
101 + "description": "Metric name (chart context)."
102 + },
103 + "availability": {
104 + "type": "array",
105 + "description": "Metric collection availability conditions. An empty list means that it is available for all conditions defined in 'metrics.availability'.",
106 + "items": {
107 + "type": "string",
108 + "description": "Availability condition name."
109 + }
110 + },
111 + "description": {
112 + "type": "string",
113 + "description": "Metric description (chart title)."
114 + },
115 + "unit": {
116 + "type": "string",
117 + "description": "Metric description (chart unit)."
118 + },
119 + "chart_type": {
120 + "type": "string",
121 + "description": "Metric description (chart type)."
122 + },
123 + "dimensions": {
124 + "type": "array",
125 + "description": "",
126 + "items": {
127 + "type": "object",
128 + "properties": {
129 + "name": {
130 + "type": "string",
131 + "description": "Dimension name."
132 + }
133 + },
134 + "required": [
135 + "name"
136 + ]
137 + }
138 + }
139 + },
140 + "required": [
141 + "name",
142 + "description",
143 + "unit",
144 + "chart_type",
145 + "dimensions"
146 + ]
147 + }
148 + }
149 + },
150 + "required": [
151 + "name",
152 + "description",
153 + "labels",
154 + "metrics"
155 + ]
156 + }
157 + }
158 + },
159 + "required": [
160 + "folding",
161 + "description",
162 + "availability",
163 + "scopes"
164 + ]
165 + },
166 + "folding": {
167 + "type": "object",
168 + "description": "Content folding settings.",
169 + "properties": {
170 + "title": {
171 + "description": "Folded content summary title",
172 + "type": "string"
173 + },
174 + "enabled": {
175 + "description": "Determines if this content should be folded",
176 + "type": "boolean"
177 + }
178 + },
179 + "required": [
180 + "title",
181 + "enabled"
182 + ]
183 + },
184 + "non-empty-string": {
185 + "type": "string",
186 + "minLength": 2
187 + }
188 + }
189 +}
collectors/metadata/schemas/single-module.json
+4 -179
@@ -208,7 +208,7 @@
208 "description": "Optional common information about options."
209 },
210 "folding": {
211 - "$ref": "#/$defs/_folding"
211 + "$ref": "./definitions.json#/definitions/folding"
212 },
213 "list": {
214 "type": "array",
@@ -270,7 +270,7 @@
270 "description": "Example name."
271 },
272 "folding": {
273 - "$ref": "#/$defs/_folding"
273 + "$ref": "./definitions.json#/definitions/folding"
274 },
275 "description": {
276 "type": "string",
@@ -399,167 +399,10 @@
399 ]
400 },
401 "alerts": {
402 - "type": "array",
403 - "description": "The list of configured alerts shipped with Netdata for this collector.",
404 - "items": {
405 - "type": "object",
406 - "description": "Information about the configured alert.",
407 - "properties": {
408 - "name": {
409 - "type": "string",
410 - "description": "Alert's 'alarm' or 'template' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-alarm-or-template)."
411 - },
412 - "link": {
413 - "type": "string",
414 - "description": "Link to github .conf file that this alert originates from"
415 - },
416 - "metric": {
417 - "type": "string",
418 - "description": "Alert's 'on' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-on)."
419 - },
420 - "info": {
421 - "type": "string",
422 - "description": "Alert's 'info' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-info)."
423 - },
424 - "os": {
425 - "type": "string",
426 - "description": "Alert's 'os' value (https://learn.netdata.cloud/docs/alerting/health-configuration-reference#alarm-line-os)."
427 - }
428 - },
429 - "required": [
430 - "name",
431 - "link",
432 - "metric",
433 - "info"
434 - ]
435 - }
402 + "$ref": "./definitions.json#/definitions/alerts"
403 },
404 "metrics": {
438 - "type": "object",
439 - "description": "Collected metrics grouped by scope. The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.",
440 - "properties": {
441 - "folding": {
442 - "$ref": "#/$defs/_folding"
443 - },
444 - "description": {
445 - "type": "string",
446 - "description": "General description of collected metrics/scopes."
447 - },
448 - "availability": {
449 - "type": "array",
450 - "description": "Metrics collection availability conditions. Some metrics are only available when certain conditions are met. For example, Apache exposes additional metrics when Extended status is configured, Consul exposes different set of metrics depends on its mode. This field should list the available conditions that will later be matched for each of the metrics.",
451 - "items": {
452 - "type": "string",
453 - "description": "Availability condition name."
454 - }
455 - },
456 - "scopes": {
457 - "type": "array",
458 - "description": "List of scopes and their metrics.",
459 - "items": {
460 - "type": "object",
461 - "properties": {
462 - "name": {
463 - "type": "string",
464 - "description": "Scope name."
465 - },
466 - "description": {
467 - "type": "string",
468 - "description": "Scope description."
469 - },
470 - "labels": {
471 - "type": "array",
472 - "description": "Label set of the scope.",
473 - "items": {
474 - "type": "object",
475 - "properties": {
476 - "name": {
477 - "type": "string",
478 - "description": "Label name."
479 - },
480 - "description": {
481 - "type": "string",
482 - "description": "Label description."
483 - }
484 - },
485 - "required": [
486 - "name",
487 - "description"
488 - ]
489 - }
490 - },
491 - "metrics": {
492 - "type": "array",
493 - "description": "List of collected metrics (chart contexts) in the scope.",
494 - "items": {
495 - "type": "object",
496 - "properties": {
497 - "name": {
498 - "type": "string",
499 - "description": "Metric name (chart context)."
500 - },
501 - "availability": {
502 - "type": "array",
503 - "description": "Metric collection availability conditions. An empty list means that it is available for all conditions defined in 'metrics.availability'.",
504 - "items": {
505 - "type": "string",
506 - "description": "Availability condition name."
507 - }
508 - },
509 - "description": {
510 - "type": "string",
511 - "description": "Metric description (chart title)."
512 - },
513 - "unit": {
514 - "type": "string",
515 - "description": "Metric description (chart unit)."
516 - },
517 - "chart_type": {
518 - "type": "string",
519 - "description": "Metric description (chart type)."
520 - },
521 - "dimensions": {
522 - "type": "array",
523 - "description": "",
524 - "items": {
525 - "type": "object",
526 - "properties": {
527 - "name": {
528 - "type": "string",
529 - "description": "Dimension name."
530 - }
531 - },
532 - "required": [
533 - "name"
534 - ]
535 - }
536 - }
537 - },
538 - "required": [
539 - "name",
540 - "description",
541 - "unit",
542 - "chart_type",
543 - "dimensions"
544 - ]
545 - }
546 - }
547 - },
548 - "required": [
549 - "name",
550 - "description",
551 - "labels",
552 - "metrics"
553 - ]
554 - }
555 - }
556 - },
557 - "required": [
558 - "folding",
559 - "description",
560 - "availability",
561 - "scopes"
562 - ]
405 + "$ref": "./definitions.json#/definitions/metrics"
406 }
407 },
408 "required": [
@@ -594,24 +437,6 @@
437 "name",
438 "link"
439 ]
597 - },
598 - "_folding": {
599 - "type": "object",
600 - "description": "Content folding settings.",
601 - "properties": {
602 - "title": {
603 - "description": "Folded content summary title",
604 - "type": "string"
605 - },
606 - "enabled": {
607 - "description": "Determines if this content should be folded",
608 - "type": "boolean"
609 - }
610 - },
611 - "required": [
612 - "title",
613 - "enabled"
614 - ]
440 }
441 }
442 }