@intentius/chant-lexicon-grafana 0.99.0 → 0.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +12 -6
  2. package/dist/annotations.d.ts +61 -0
  3. package/dist/annotations.d.ts.map +1 -0
  4. package/dist/api/apply.d.ts +8 -4
  5. package/dist/api/apply.d.ts.map +1 -1
  6. package/dist/api/fake-grafana.d.ts +2 -0
  7. package/dist/api/fake-grafana.d.ts.map +1 -1
  8. package/dist/api/folders.d.ts +53 -17
  9. package/dist/api/folders.d.ts.map +1 -1
  10. package/dist/build.d.ts +26 -5
  11. package/dist/build.d.ts.map +1 -1
  12. package/dist/catalog.d.ts +1 -1
  13. package/dist/catalog.d.ts.map +1 -1
  14. package/dist/codegen/docs.d.ts.map +1 -1
  15. package/dist/codegen/generate.d.ts +7 -1
  16. package/dist/codegen/generate.d.ts.map +1 -1
  17. package/dist/composites/shared.d.ts +4 -3
  18. package/dist/composites/shared.d.ts.map +1 -1
  19. package/dist/dashboard.d.ts +42 -14
  20. package/dist/dashboard.d.ts.map +1 -1
  21. package/dist/datasource-refs.d.ts +9 -5
  22. package/dist/datasource-refs.d.ts.map +1 -1
  23. package/dist/datasource-settings.d.ts +834 -0
  24. package/dist/datasource-settings.d.ts.map +1 -0
  25. package/dist/datasource.d.ts +53 -11
  26. package/dist/datasource.d.ts.map +1 -1
  27. package/dist/deep-observe-hooks.d.ts +1 -1
  28. package/dist/deep-observe-hooks.d.ts.map +1 -1
  29. package/dist/deep-observe.d.ts +9 -4
  30. package/dist/deep-observe.d.ts.map +1 -1
  31. package/dist/describe-resources.d.ts +1 -0
  32. package/dist/describe-resources.d.ts.map +1 -1
  33. package/dist/detect.d.ts +4 -2
  34. package/dist/detect.d.ts.map +1 -1
  35. package/dist/folder.d.ts +68 -0
  36. package/dist/folder.d.ts.map +1 -0
  37. package/dist/import/generator.d.ts.map +1 -1
  38. package/dist/import/mappings.d.ts +12 -6
  39. package/dist/import/mappings.d.ts.map +1 -1
  40. package/dist/import/model.d.ts +7 -0
  41. package/dist/import/model.d.ts.map +1 -1
  42. package/dist/import/normalize.d.ts.map +1 -1
  43. package/dist/import/parser.d.ts +16 -1
  44. package/dist/import/parser.d.ts.map +1 -1
  45. package/dist/import/testdata/fixtures.d.ts +6 -0
  46. package/dist/import/testdata/fixtures.d.ts.map +1 -1
  47. package/dist/import/v2.d.ts +4 -3
  48. package/dist/import/v2.d.ts.map +1 -1
  49. package/dist/index.d.ts +11 -9
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/init-templates.d.ts +27 -0
  52. package/dist/init-templates.d.ts.map +1 -0
  53. package/dist/integrity.json +11 -9
  54. package/dist/lint/audit-catalog.d.ts +1 -1
  55. package/dist/lint/audit-catalog.d.ts.map +1 -1
  56. package/dist/lint/post-synth/graf101.d.ts +1 -1
  57. package/dist/lint/post-synth/graf104.d.ts +2 -2
  58. package/dist/lint/post-synth/graf106.d.ts +2 -2
  59. package/dist/lint/post-synth/graf110.d.ts +8 -0
  60. package/dist/lint/post-synth/graf110.d.ts.map +1 -0
  61. package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -1
  62. package/dist/lint/post-synth/index.d.ts.map +1 -1
  63. package/dist/manifest.json +1 -1
  64. package/dist/meta.json +70 -0
  65. package/dist/okf/index.md +18 -3
  66. package/dist/okf/rules/GRAF101.md +2 -2
  67. package/dist/okf/rules/GRAF104.md +2 -2
  68. package/dist/okf/rules/GRAF106.md +2 -2
  69. package/dist/okf/rules/GRAF110.md +11 -0
  70. package/dist/okf/types/AdhocVariable.md +9 -0
  71. package/dist/okf/types/AzureMonitorQuery.md +9 -0
  72. package/dist/okf/types/BigQueryQuery.md +9 -0
  73. package/dist/okf/types/CloudMonitoringQuery.md +9 -0
  74. package/dist/okf/types/CloudWatchQuery.md +9 -0
  75. package/dist/okf/types/Dashboard.md +1 -1
  76. package/dist/okf/types/Datasource.md +1 -1
  77. package/dist/okf/types/DatasourceProvisioning.md +9 -0
  78. package/dist/okf/types/ElasticsearchQuery.md +9 -0
  79. package/dist/okf/types/ExternalDatasource.md +1 -1
  80. package/dist/okf/types/Folder.md +9 -0
  81. package/dist/okf/types/GroupByVariable.md +9 -0
  82. package/dist/okf/types/MSSQLQuery.md +9 -0
  83. package/dist/okf/types/MySQLQuery.md +9 -0
  84. package/dist/okf/types/PostgresQuery.md +9 -0
  85. package/dist/okf/types/PyroscopeQuery.md +9 -0
  86. package/dist/okf/types/SwitchVariable.md +9 -0
  87. package/dist/op/activities/grafana-apply.d.ts +11 -0
  88. package/dist/op/activities/grafana-apply.d.ts.map +1 -1
  89. package/dist/op/activities/index.d.ts +1 -1
  90. package/dist/op/activities/index.d.ts.map +1 -1
  91. package/dist/ownership.d.ts +11 -0
  92. package/dist/ownership.d.ts.map +1 -1
  93. package/dist/pin.d.ts +1 -1
  94. package/dist/pin.d.ts.map +1 -1
  95. package/dist/plugin.d.ts.map +1 -1
  96. package/dist/promql-check.d.ts.map +1 -1
  97. package/dist/query-models.d.ts +95 -0
  98. package/dist/query-models.d.ts.map +1 -0
  99. package/dist/query.d.ts +107 -10
  100. package/dist/query.d.ts.map +1 -1
  101. package/dist/rules/graf101.ts +2 -2
  102. package/dist/rules/graf104.ts +3 -3
  103. package/dist/rules/graf106.ts +3 -3
  104. package/dist/rules/graf110.ts +17 -0
  105. package/dist/rules/grafana-helpers.ts +13 -3
  106. package/dist/schema/azuremonitor.gen.d.ts +354 -0
  107. package/dist/schema/azuremonitor.gen.d.ts.map +1 -0
  108. package/dist/schema/bigquery.gen.d.ts +93 -0
  109. package/dist/schema/bigquery.gen.d.ts.map +1 -0
  110. package/dist/schema/cloudwatch.gen.d.ts +394 -0
  111. package/dist/schema/cloudwatch.gen.d.ts.map +1 -0
  112. package/dist/schema/elasticsearch.gen.d.ts +444 -0
  113. package/dist/schema/elasticsearch.gen.d.ts.map +1 -0
  114. package/dist/schema/googlecloudmonitoring.gen.d.ts +312 -0
  115. package/dist/schema/googlecloudmonitoring.gen.d.ts.map +1 -0
  116. package/dist/schema/grafanapyroscope.gen.d.ts +60 -0
  117. package/dist/schema/grafanapyroscope.gen.d.ts.map +1 -0
  118. package/dist/schema/index.d.ts +6 -0
  119. package/dist/schema/index.d.ts.map +1 -1
  120. package/dist/schema/table.gen.d.ts +13 -0
  121. package/dist/schema/table.gen.d.ts.map +1 -1
  122. package/dist/schema-validate.d.ts +9 -0
  123. package/dist/schema-validate.d.ts.map +1 -1
  124. package/dist/skill-defs.d.ts.map +1 -1
  125. package/dist/skills/chant-grafana-operations.md +108 -0
  126. package/dist/skills/chant-grafana.md +5 -4
  127. package/dist/spec/schemas.d.ts +9 -7
  128. package/dist/spec/schemas.d.ts.map +1 -1
  129. package/dist/spec/schemas.gen.d.ts +3 -0
  130. package/dist/spec/schemas.gen.d.ts.map +1 -0
  131. package/dist/validate-alerting.d.ts.map +1 -1
  132. package/dist/validate-output.d.ts +15 -2
  133. package/dist/validate-output.d.ts.map +1 -1
  134. package/dist/validate.d.ts.map +1 -1
  135. package/dist/validation.d.ts +14 -0
  136. package/dist/validation.d.ts.map +1 -0
  137. package/dist/variables.d.ts +102 -5
  138. package/dist/variables.d.ts.map +1 -1
  139. package/package.json +2 -2
  140. package/src/annotations.ts +84 -0
  141. package/src/api/apply.test.ts +19 -1
  142. package/src/api/apply.ts +18 -8
  143. package/src/api/fake-grafana.ts +6 -2
  144. package/src/api/folders.ts +106 -32
  145. package/src/build.test.ts +142 -6
  146. package/src/build.ts +126 -24
  147. package/src/catalog.ts +20 -2
  148. package/src/codegen/docs.ts +13 -6
  149. package/src/codegen/generate.ts +27 -1
  150. package/src/composites/shared.ts +3 -2
  151. package/src/dashboard.ts +59 -14
  152. package/src/datasource-refs.ts +30 -6
  153. package/src/datasource-settings.test.ts +106 -0
  154. package/src/datasource-settings.ts +941 -0
  155. package/src/datasource.ts +71 -11
  156. package/src/deep-observe-hooks.ts +16 -1
  157. package/src/deep-observe.test.ts +47 -1
  158. package/src/deep-observe.ts +36 -13
  159. package/src/describe-resources.test.ts +16 -0
  160. package/src/describe-resources.ts +36 -1
  161. package/src/detect.ts +3 -3
  162. package/src/folder.ts +118 -0
  163. package/src/generated/lexicon-grafana.json +70 -0
  164. package/src/import/generated-types.e2e.test.ts +15 -3
  165. package/src/import/generator.ts +2 -1
  166. package/src/import/mappings.ts +98 -26
  167. package/src/import/model.ts +7 -0
  168. package/src/import/normalize.ts +32 -3
  169. package/src/import/parser.test.ts +97 -21
  170. package/src/import/parser.ts +169 -18
  171. package/src/import/roundtrip.test.ts +104 -9
  172. package/src/import/testdata/fixtures.ts +8 -0
  173. package/src/import/v2.ts +4 -3
  174. package/src/index.ts +122 -13
  175. package/src/init-templates.test.ts +74 -0
  176. package/src/init-templates.ts +349 -0
  177. package/src/lint/audit-catalog.ts +9 -1
  178. package/src/lint/post-synth/graf101.ts +2 -2
  179. package/src/lint/post-synth/graf104.ts +3 -3
  180. package/src/lint/post-synth/graf106.ts +3 -3
  181. package/src/lint/post-synth/graf110.ts +17 -0
  182. package/src/lint/post-synth/grafana-helpers.ts +13 -3
  183. package/src/lint/post-synth/index.ts +2 -0
  184. package/src/lint/post-synth/post-synth.test.ts +99 -2
  185. package/src/load-cost.test.ts +35 -0
  186. package/src/op/activities/grafana-apply.e2e.test.ts +14 -5
  187. package/src/op/activities/grafana-apply.test.ts +16 -2
  188. package/src/op/activities/grafana-apply.ts +29 -3
  189. package/src/op/activities/index.ts +1 -1
  190. package/src/ownership.ts +19 -0
  191. package/src/panels.test.ts +3 -1
  192. package/src/pin.ts +12 -0
  193. package/src/plugin.test.ts +9 -2
  194. package/src/plugin.ts +9 -0
  195. package/src/promql-check.ts +5 -1
  196. package/src/query-models.ts +94 -0
  197. package/src/query.test.ts +166 -0
  198. package/src/query.ts +177 -12
  199. package/src/schema/azuremonitor.gen.ts +381 -0
  200. package/src/schema/bigquery.gen.ts +110 -0
  201. package/src/schema/cloudwatch.gen.ts +423 -0
  202. package/src/schema/elasticsearch.gen.ts +508 -0
  203. package/src/schema/googlecloudmonitoring.gen.ts +330 -0
  204. package/src/schema/grafanapyroscope.gen.ts +66 -0
  205. package/src/schema/index.ts +6 -0
  206. package/src/schema/table.gen.ts +14 -0
  207. package/src/schema-validate.ts +58 -7
  208. package/src/skill-defs.ts +17 -0
  209. package/src/skills/chant-grafana-operations.md +108 -0
  210. package/src/skills/chant-grafana.md +5 -4
  211. package/src/spec/overlay/table.overlay.json +19 -0
  212. package/src/spec/schemas/azuremonitor.jsonschema.json +679 -0
  213. package/src/spec/schemas/bigquery.jsonschema.json +290 -0
  214. package/src/spec/schemas/cloudwatch.jsonschema.json +721 -0
  215. package/src/spec/schemas/elasticsearch.jsonschema.json +1695 -0
  216. package/src/spec/schemas/googlecloudmonitoring.jsonschema.json +488 -0
  217. package/src/spec/schemas/grafanapyroscope.jsonschema.json +93 -0
  218. package/src/spec/schemas.gen.ts +40 -0
  219. package/src/spec/schemas.ts +9 -7
  220. package/src/validate-alerting.ts +4 -2
  221. package/src/validate-output.ts +96 -4
  222. package/src/validate.ts +14 -0
  223. package/src/validation.ts +27 -0
  224. package/src/variables.ts +113 -6
@@ -0,0 +1,488 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/CloudMonitoringQuery",
4
+ "definitions": {
5
+ "CloudMonitoringQuery": {
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "refId": {
10
+ "anyOf": [
11
+ {
12
+ "type": "string"
13
+ },
14
+ {
15
+ "type": "null"
16
+ }
17
+ ],
18
+ "description": "A unique identifier for the query within the list of targets.\nIn server side expressions, the refId is used as a variable name to identify results.\nBy default, the UI will assign A-\u003eZ; however setting meaningful names may be useful."
19
+ },
20
+ "hide": {
21
+ "type": "boolean",
22
+ "description": "If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel."
23
+ },
24
+ "queryType": {
25
+ "type": "string",
26
+ "description": "Specify the query flavor\nTODO make this required and give it a default"
27
+ },
28
+ "aliasBy": {
29
+ "type": "string",
30
+ "description": "Aliases can be set to modify the legend labels. e.g. {{metric.label.xxx}}. See docs for more detail."
31
+ },
32
+ "timeSeriesList": {
33
+ "$ref": "#/definitions/TimeSeriesList",
34
+ "description": "GCM query type.\nqueryType: #QueryType\nTime Series List sub-query properties."
35
+ },
36
+ "timeSeriesQuery": {
37
+ "$ref": "#/definitions/TimeSeriesQuery",
38
+ "description": "Time Series sub-query properties."
39
+ },
40
+ "sloQuery": {
41
+ "$ref": "#/definitions/SLOQuery",
42
+ "description": "SLO sub-query properties."
43
+ },
44
+ "promQLQuery": {
45
+ "$ref": "#/definitions/PromQLQuery",
46
+ "description": "PromQL sub-query properties."
47
+ },
48
+ "datasource": {
49
+ "$ref": "#/definitions/DataSourceRef",
50
+ "description": "For mixed data sources the selected datasource is on the query level.\nFor non mixed scenarios this is undefined.\nTODO find a better way to do this ^ that's friendly to schema\nTODO this shouldn't be unknown but DataSourceRef | null"
51
+ },
52
+ "intervalMs": {
53
+ "type": "number",
54
+ "description": "Time interval in milliseconds."
55
+ }
56
+ }
57
+ },
58
+ "TimeSeriesList": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": [
62
+ "projectName",
63
+ "crossSeriesReducer"
64
+ ],
65
+ "properties": {
66
+ "projectName": {
67
+ "type": "string",
68
+ "description": "GCP project to execute the query against."
69
+ },
70
+ "crossSeriesReducer": {
71
+ "type": "string",
72
+ "description": "Reducer applied across a set of time-series values. Defaults to REDUCE_NONE."
73
+ },
74
+ "alignmentPeriod": {
75
+ "type": "string",
76
+ "description": "Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto."
77
+ },
78
+ "perSeriesAligner": {
79
+ "type": "string",
80
+ "description": "Alignment function to be used. Defaults to ALIGN_MEAN."
81
+ },
82
+ "groupBys": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "string"
86
+ },
87
+ "description": "Array of labels to group data by."
88
+ },
89
+ "filters": {
90
+ "type": "array",
91
+ "items": {
92
+ "type": "string"
93
+ },
94
+ "description": "Array of filters to query data by. Labels that can be filtered on are defined by the metric."
95
+ },
96
+ "view": {
97
+ "type": "string",
98
+ "description": "Data view, defaults to FULL."
99
+ },
100
+ "title": {
101
+ "type": "string",
102
+ "description": "Annotation title."
103
+ },
104
+ "text": {
105
+ "type": "string",
106
+ "description": "Annotation text."
107
+ },
108
+ "secondaryCrossSeriesReducer": {
109
+ "type": "string",
110
+ "description": "Only present if a preprocessor is selected. Reducer applied across a set of time-series values. Defaults to REDUCE_NONE."
111
+ },
112
+ "secondaryAlignmentPeriod": {
113
+ "type": "string",
114
+ "description": "Only present if a preprocessor is selected. Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto."
115
+ },
116
+ "secondaryPerSeriesAligner": {
117
+ "type": "string",
118
+ "description": "Only present if a preprocessor is selected. Alignment function to be used. Defaults to ALIGN_MEAN."
119
+ },
120
+ "secondaryGroupBys": {
121
+ "type": "array",
122
+ "items": {
123
+ "type": "string"
124
+ },
125
+ "description": "Only present if a preprocessor is selected. Array of labels to group data by."
126
+ },
127
+ "preprocessor": {
128
+ "$ref": "#/definitions/PreprocessorType",
129
+ "description": "Preprocessor is not part of the API, but is used to store the preprocessor and not affect the UI for the rest of parameters"
130
+ }
131
+ },
132
+ "description": "Time Series List sub-query properties."
133
+ },
134
+ "PreprocessorType": {
135
+ "enum": [
136
+ "none",
137
+ "rate",
138
+ "delta"
139
+ ],
140
+ "type": "string",
141
+ "description": "Types of pre-processor available. Defined by the metric."
142
+ },
143
+ "TimeSeriesQuery": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": [
147
+ "projectName",
148
+ "query"
149
+ ],
150
+ "properties": {
151
+ "projectName": {
152
+ "type": "string",
153
+ "description": "GCP project to execute the query against."
154
+ },
155
+ "query": {
156
+ "type": "string",
157
+ "description": "MQL query to be executed."
158
+ },
159
+ "graphPeriod": {
160
+ "type": "string",
161
+ "description": "To disable the graphPeriod, it should explictly be set to 'disabled'.",
162
+ "default": "disabled"
163
+ }
164
+ },
165
+ "description": "Time Series sub-query properties."
166
+ },
167
+ "SLOQuery": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "required": [
171
+ "projectName",
172
+ "selectorName",
173
+ "serviceId",
174
+ "serviceName",
175
+ "sloId",
176
+ "sloName"
177
+ ],
178
+ "properties": {
179
+ "projectName": {
180
+ "type": "string",
181
+ "description": "GCP project to execute the query against."
182
+ },
183
+ "perSeriesAligner": {
184
+ "type": "string",
185
+ "description": "Alignment function to be used. Defaults to ALIGN_MEAN."
186
+ },
187
+ "alignmentPeriod": {
188
+ "type": "string",
189
+ "description": "Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto."
190
+ },
191
+ "selectorName": {
192
+ "type": "string",
193
+ "description": "SLO selector."
194
+ },
195
+ "serviceId": {
196
+ "type": "string",
197
+ "description": "ID for the service the SLO is in."
198
+ },
199
+ "serviceName": {
200
+ "type": "string",
201
+ "description": "Name for the service the SLO is in."
202
+ },
203
+ "sloId": {
204
+ "type": "string",
205
+ "description": "ID for the SLO."
206
+ },
207
+ "sloName": {
208
+ "type": "string",
209
+ "description": "Name of the SLO."
210
+ },
211
+ "goal": {
212
+ "type": "number",
213
+ "description": "SLO goal value."
214
+ },
215
+ "lookbackPeriod": {
216
+ "type": "string",
217
+ "description": "Specific lookback period for the SLO."
218
+ }
219
+ },
220
+ "description": "SLO sub-query properties."
221
+ },
222
+ "PromQLQuery": {
223
+ "type": "object",
224
+ "additionalProperties": false,
225
+ "required": [
226
+ "projectName",
227
+ "expr",
228
+ "step"
229
+ ],
230
+ "properties": {
231
+ "projectName": {
232
+ "type": "string",
233
+ "description": "GCP project to execute the query against."
234
+ },
235
+ "expr": {
236
+ "type": "string",
237
+ "description": "PromQL expression/query to be executed."
238
+ },
239
+ "step": {
240
+ "type": "string",
241
+ "description": "PromQL min step"
242
+ }
243
+ },
244
+ "description": "PromQL sub-query properties."
245
+ },
246
+ "QueryType": {
247
+ "enum": [
248
+ "timeSeriesList",
249
+ "timeSeriesQuery",
250
+ "slo",
251
+ "annotation",
252
+ "promQL"
253
+ ],
254
+ "type": "string",
255
+ "description": "Defines the supported queryTypes."
256
+ },
257
+ "MetricQuery": {
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "required": [
261
+ "projectName",
262
+ "editorMode",
263
+ "metricType",
264
+ "crossSeriesReducer",
265
+ "query"
266
+ ],
267
+ "properties": {
268
+ "projectName": {
269
+ "type": "string",
270
+ "description": "GCP project to execute the query against."
271
+ },
272
+ "perSeriesAligner": {
273
+ "type": "string",
274
+ "description": "Alignment function to be used. Defaults to ALIGN_MEAN."
275
+ },
276
+ "alignmentPeriod": {
277
+ "type": "string",
278
+ "description": "Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto."
279
+ },
280
+ "aliasBy": {
281
+ "type": "string",
282
+ "description": "Aliases can be set to modify the legend labels. e.g. {{metric.label.xxx}}. See docs for more detail."
283
+ },
284
+ "editorMode": {
285
+ "type": "string"
286
+ },
287
+ "metricType": {
288
+ "type": "string"
289
+ },
290
+ "crossSeriesReducer": {
291
+ "type": "string",
292
+ "description": "Reducer applied across a set of time-series values. Defaults to REDUCE_NONE."
293
+ },
294
+ "groupBys": {
295
+ "type": "array",
296
+ "items": {
297
+ "type": "string"
298
+ },
299
+ "description": "Array of labels to group data by."
300
+ },
301
+ "filters": {
302
+ "type": "array",
303
+ "items": {
304
+ "type": "string"
305
+ },
306
+ "description": "Array of filters to query data by. Labels that can be filtered on are defined by the metric."
307
+ },
308
+ "metricKind": {
309
+ "$ref": "#/definitions/MetricKind"
310
+ },
311
+ "valueType": {
312
+ "type": "string"
313
+ },
314
+ "view": {
315
+ "type": "string"
316
+ },
317
+ "query": {
318
+ "type": "string",
319
+ "description": "MQL query to be executed."
320
+ },
321
+ "preprocessor": {
322
+ "$ref": "#/definitions/PreprocessorType",
323
+ "description": "Preprocessor is not part of the API, but is used to store the preprocessor and not affect the UI for the rest of parameters"
324
+ },
325
+ "graphPeriod": {
326
+ "type": "string",
327
+ "description": "To disable the graphPeriod, it should explictly be set to 'disabled'.",
328
+ "default": "disabled"
329
+ }
330
+ },
331
+ "description": "@deprecated This type is for migration purposes only. Replaced by TimeSeriesList Metric sub-query properties."
332
+ },
333
+ "MetricKind": {
334
+ "enum": [
335
+ "METRIC_KIND_UNSPECIFIED",
336
+ "GAUGE",
337
+ "DELTA",
338
+ "CUMULATIVE"
339
+ ],
340
+ "type": "string"
341
+ },
342
+ "ValueTypes": {
343
+ "enum": [
344
+ "VALUE_TYPE_UNSPECIFIED",
345
+ "BOOL",
346
+ "INT64",
347
+ "DOUBLE",
348
+ "STRING",
349
+ "DISTRIBUTION",
350
+ "MONEY"
351
+ ],
352
+ "type": "string"
353
+ },
354
+ "AlignmentTypes": {
355
+ "enum": [
356
+ "ALIGN_DELTA",
357
+ "ALIGN_RATE",
358
+ "ALIGN_INTERPOLATE",
359
+ "ALIGN_NEXT_OLDER",
360
+ "ALIGN_MIN",
361
+ "ALIGN_MAX",
362
+ "ALIGN_MEAN",
363
+ "ALIGN_COUNT",
364
+ "ALIGN_SUM",
365
+ "ALIGN_STDDEV",
366
+ "ALIGN_COUNT_TRUE",
367
+ "ALIGN_COUNT_FALSE",
368
+ "ALIGN_FRACTION_TRUE",
369
+ "ALIGN_PERCENTILE_99",
370
+ "ALIGN_PERCENTILE_95",
371
+ "ALIGN_PERCENTILE_50",
372
+ "ALIGN_PERCENTILE_05",
373
+ "ALIGN_PERCENT_CHANGE",
374
+ "ALIGN_NONE"
375
+ ],
376
+ "type": "string"
377
+ },
378
+ "LegacyCloudMonitoringAnnotationQuery": {
379
+ "type": "object",
380
+ "additionalProperties": false,
381
+ "required": [
382
+ "projectName",
383
+ "metricType",
384
+ "refId",
385
+ "filters",
386
+ "metricKind",
387
+ "valueType",
388
+ "title",
389
+ "text"
390
+ ],
391
+ "properties": {
392
+ "projectName": {
393
+ "type": "string",
394
+ "description": "GCP project to execute the query against."
395
+ },
396
+ "metricType": {
397
+ "type": "string"
398
+ },
399
+ "refId": {
400
+ "type": "string",
401
+ "description": "Query refId."
402
+ },
403
+ "filters": {
404
+ "type": "array",
405
+ "items": {
406
+ "type": "string"
407
+ },
408
+ "description": "Array of filters to query data by. Labels that can be filtered on are defined by the metric."
409
+ },
410
+ "metricKind": {
411
+ "$ref": "#/definitions/MetricKind"
412
+ },
413
+ "valueType": {
414
+ "type": "string"
415
+ },
416
+ "title": {
417
+ "type": "string",
418
+ "description": "Annotation title."
419
+ },
420
+ "text": {
421
+ "type": "string",
422
+ "description": "Annotation text."
423
+ }
424
+ },
425
+ "description": "@deprecated Use TimeSeriesList instead. Legacy annotation query properties for migration purposes."
426
+ },
427
+ "Filter": {
428
+ "type": "object",
429
+ "additionalProperties": false,
430
+ "required": [
431
+ "key",
432
+ "operator",
433
+ "value"
434
+ ],
435
+ "properties": {
436
+ "key": {
437
+ "type": "string",
438
+ "description": "Filter key."
439
+ },
440
+ "operator": {
441
+ "type": "string",
442
+ "description": "Filter operator."
443
+ },
444
+ "value": {
445
+ "type": "string",
446
+ "description": "Filter value."
447
+ },
448
+ "condition": {
449
+ "type": "string",
450
+ "description": "Filter condition."
451
+ }
452
+ },
453
+ "description": "Query filter representation."
454
+ },
455
+ "MetricFindQueryTypes": {
456
+ "enum": [
457
+ "projects",
458
+ "services",
459
+ "defaultProject",
460
+ "metricTypes",
461
+ "labelKeys",
462
+ "labelValues",
463
+ "resourceTypes",
464
+ "aggregations",
465
+ "aligners",
466
+ "alignmentPeriods",
467
+ "selectors",
468
+ "sloServices",
469
+ "slo"
470
+ ],
471
+ "type": "string"
472
+ },
473
+ "DataSourceRef": {
474
+ "type": "object",
475
+ "additionalProperties": false,
476
+ "properties": {
477
+ "type": {
478
+ "type": "string",
479
+ "description": "The plugin type-id"
480
+ },
481
+ "uid": {
482
+ "type": "string",
483
+ "description": "Specific datasource instance"
484
+ }
485
+ }
486
+ }
487
+ }
488
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/dataquery",
4
+ "definitions": {
5
+ "PyroscopeQueryType": {
6
+ "enum": [
7
+ "metrics",
8
+ "profile",
9
+ "both"
10
+ ],
11
+ "type": "string"
12
+ },
13
+ "dataquery": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": [
17
+ "labelSelector",
18
+ "profileTypeId",
19
+ "groupBy"
20
+ ],
21
+ "properties": {
22
+ "labelSelector": {
23
+ "type": "string",
24
+ "description": "Specifies the query label selectors.",
25
+ "default": "{}"
26
+ },
27
+ "spanSelector": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "string"
31
+ },
32
+ "description": "Specifies the query span selectors."
33
+ },
34
+ "profileTypeId": {
35
+ "type": "string",
36
+ "description": "Specifies the type of profile to query."
37
+ },
38
+ "groupBy": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ },
43
+ "description": "Allows to group the results."
44
+ },
45
+ "limit": {
46
+ "type": "integer",
47
+ "description": "Sets the maximum number of time series."
48
+ },
49
+ "maxNodes": {
50
+ "type": "integer",
51
+ "description": "Sets the maximum number of nodes in the flamegraph."
52
+ },
53
+ "refId": {
54
+ "anyOf": [
55
+ {
56
+ "type": "string"
57
+ },
58
+ {
59
+ "type": "null"
60
+ }
61
+ ],
62
+ "description": "A unique identifier for the query within the list of targets.\nIn server side expressions, the refId is used as a variable name to identify results.\nBy default, the UI will assign A-\u003eZ; however setting meaningful names may be useful."
63
+ },
64
+ "hide": {
65
+ "type": "boolean",
66
+ "description": "If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel."
67
+ },
68
+ "queryType": {
69
+ "type": "string",
70
+ "description": "Specify the query flavor\nTODO make this required and give it a default"
71
+ },
72
+ "datasource": {
73
+ "$ref": "#/definitions/DataSourceRef",
74
+ "description": "For mixed data sources the selected datasource is on the query level.\nFor non mixed scenarios this is undefined.\nTODO find a better way to do this ^ that's friendly to schema\nTODO this shouldn't be unknown but DataSourceRef | null"
75
+ }
76
+ }
77
+ },
78
+ "DataSourceRef": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "properties": {
82
+ "type": {
83
+ "type": "string",
84
+ "description": "The plugin type-id"
85
+ },
86
+ "uid": {
87
+ "type": "string",
88
+ "description": "Specific datasource instance"
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }