Skip to content

Commit 3a50962

Browse files
apmmachineapmmachine
andauthored
synchronize json schema specs (#1144)
Co-authored-by: apmmachine <[email protected]>
1 parent e0f7a3f commit 3a50962

File tree

1 file changed

+108
-3
lines changed

1 file changed

+108
-3
lines changed

tests/upstream/json-specs/metricset.json

Lines changed: 108 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,118 @@
1313
"object"
1414
],
1515
"properties": {
16+
"counts": {
17+
"description": "Counts holds the bucket counts for histogram metrics. These numbers must be positive or zero. If Counts is specified, then Values is expected to be specified with the same number of elements, and with the same order.",
18+
"type": [
19+
"null",
20+
"array"
21+
],
22+
"items": {
23+
"type": "integer",
24+
"minimum": 0
25+
},
26+
"minItems": 0
27+
},
28+
"type": {
29+
"description": "Type holds an optional metric type: gauge, counter, or histogram. If Type is unknown, it will be ignored.",
30+
"type": [
31+
"null",
32+
"string"
33+
]
34+
},
35+
"unit": {
36+
"description": "Unit holds an optional unit for the metric. - \"percent\" (value is in the range [0,1]) - \"byte\" - a time unit: \"nanos\", \"micros\", \"ms\", \"s\", \"m\", \"h\", \"d\" If Unit is unknown, it will be ignored.",
37+
"type": [
38+
"null",
39+
"string"
40+
]
41+
},
1642
"value": {
1743
"description": "Value holds the value of a single metric sample.",
18-
"type": "number"
44+
"type": [
45+
"null",
46+
"number"
47+
]
48+
},
49+
"values": {
50+
"description": "Values holds the bucket values for histogram metrics. Values must be provided in ascending order; failure to do so will result in the metric being discarded.",
51+
"type": [
52+
"null",
53+
"array"
54+
],
55+
"items": {
56+
"type": "number"
57+
},
58+
"minItems": 0
1959
}
2060
},
21-
"required": [
22-
"value"
61+
"allOf": [
62+
{
63+
"if": {
64+
"properties": {
65+
"counts": {
66+
"type": "array"
67+
}
68+
},
69+
"required": [
70+
"counts"
71+
]
72+
},
73+
"then": {
74+
"properties": {
75+
"values": {
76+
"type": "array"
77+
}
78+
},
79+
"required": [
80+
"values"
81+
]
82+
}
83+
},
84+
{
85+
"if": {
86+
"properties": {
87+
"values": {
88+
"type": "array"
89+
}
90+
},
91+
"required": [
92+
"values"
93+
]
94+
},
95+
"then": {
96+
"properties": {
97+
"counts": {
98+
"type": "array"
99+
}
100+
},
101+
"required": [
102+
"counts"
103+
]
104+
}
105+
}
106+
],
107+
"anyOf": [
108+
{
109+
"properties": {
110+
"value": {
111+
"type": "number"
112+
}
113+
},
114+
"required": [
115+
"value"
116+
]
117+
},
118+
{
119+
"properties": {
120+
"values": {
121+
"type": "array"
122+
}
123+
},
124+
"required": [
125+
"values"
126+
]
127+
}
23128
]
24129
}
25130
}

0 commit comments

Comments
 (0)