@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.
- package/README.md +12 -6
- package/dist/annotations.d.ts +61 -0
- package/dist/annotations.d.ts.map +1 -0
- package/dist/api/apply.d.ts +8 -4
- package/dist/api/apply.d.ts.map +1 -1
- package/dist/api/fake-grafana.d.ts +2 -0
- package/dist/api/fake-grafana.d.ts.map +1 -1
- package/dist/api/folders.d.ts +53 -17
- package/dist/api/folders.d.ts.map +1 -1
- package/dist/build.d.ts +26 -5
- package/dist/build.d.ts.map +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/generate.d.ts +7 -1
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/composites/shared.d.ts +4 -3
- package/dist/composites/shared.d.ts.map +1 -1
- package/dist/dashboard.d.ts +42 -14
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/datasource-refs.d.ts +9 -5
- package/dist/datasource-refs.d.ts.map +1 -1
- package/dist/datasource-settings.d.ts +834 -0
- package/dist/datasource-settings.d.ts.map +1 -0
- package/dist/datasource.d.ts +53 -11
- package/dist/datasource.d.ts.map +1 -1
- package/dist/deep-observe-hooks.d.ts +1 -1
- package/dist/deep-observe-hooks.d.ts.map +1 -1
- package/dist/deep-observe.d.ts +9 -4
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/describe-resources.d.ts +1 -0
- package/dist/describe-resources.d.ts.map +1 -1
- package/dist/detect.d.ts +4 -2
- package/dist/detect.d.ts.map +1 -1
- package/dist/folder.d.ts +68 -0
- package/dist/folder.d.ts.map +1 -0
- package/dist/import/generator.d.ts.map +1 -1
- package/dist/import/mappings.d.ts +12 -6
- package/dist/import/mappings.d.ts.map +1 -1
- package/dist/import/model.d.ts +7 -0
- package/dist/import/model.d.ts.map +1 -1
- package/dist/import/normalize.d.ts.map +1 -1
- package/dist/import/parser.d.ts +16 -1
- package/dist/import/parser.d.ts.map +1 -1
- package/dist/import/testdata/fixtures.d.ts +6 -0
- package/dist/import/testdata/fixtures.d.ts.map +1 -1
- package/dist/import/v2.d.ts +4 -3
- package/dist/import/v2.d.ts.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/init-templates.d.ts +27 -0
- package/dist/init-templates.d.ts.map +1 -0
- package/dist/integrity.json +11 -9
- package/dist/lint/audit-catalog.d.ts +1 -1
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/post-synth/graf101.d.ts +1 -1
- package/dist/lint/post-synth/graf104.d.ts +2 -2
- package/dist/lint/post-synth/graf106.d.ts +2 -2
- package/dist/lint/post-synth/graf110.d.ts +8 -0
- package/dist/lint/post-synth/graf110.d.ts.map +1 -0
- package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/meta.json +70 -0
- package/dist/okf/index.md +18 -3
- package/dist/okf/rules/GRAF101.md +2 -2
- package/dist/okf/rules/GRAF104.md +2 -2
- package/dist/okf/rules/GRAF106.md +2 -2
- package/dist/okf/rules/GRAF110.md +11 -0
- package/dist/okf/types/AdhocVariable.md +9 -0
- package/dist/okf/types/AzureMonitorQuery.md +9 -0
- package/dist/okf/types/BigQueryQuery.md +9 -0
- package/dist/okf/types/CloudMonitoringQuery.md +9 -0
- package/dist/okf/types/CloudWatchQuery.md +9 -0
- package/dist/okf/types/Dashboard.md +1 -1
- package/dist/okf/types/Datasource.md +1 -1
- package/dist/okf/types/DatasourceProvisioning.md +9 -0
- package/dist/okf/types/ElasticsearchQuery.md +9 -0
- package/dist/okf/types/ExternalDatasource.md +1 -1
- package/dist/okf/types/Folder.md +9 -0
- package/dist/okf/types/GroupByVariable.md +9 -0
- package/dist/okf/types/MSSQLQuery.md +9 -0
- package/dist/okf/types/MySQLQuery.md +9 -0
- package/dist/okf/types/PostgresQuery.md +9 -0
- package/dist/okf/types/PyroscopeQuery.md +9 -0
- package/dist/okf/types/SwitchVariable.md +9 -0
- package/dist/op/activities/grafana-apply.d.ts +11 -0
- package/dist/op/activities/grafana-apply.d.ts.map +1 -1
- package/dist/op/activities/index.d.ts +1 -1
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/ownership.d.ts +11 -0
- package/dist/ownership.d.ts.map +1 -1
- package/dist/pin.d.ts +1 -1
- package/dist/pin.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/promql-check.d.ts.map +1 -1
- package/dist/query-models.d.ts +95 -0
- package/dist/query-models.d.ts.map +1 -0
- package/dist/query.d.ts +107 -10
- package/dist/query.d.ts.map +1 -1
- package/dist/rules/graf101.ts +2 -2
- package/dist/rules/graf104.ts +3 -3
- package/dist/rules/graf106.ts +3 -3
- package/dist/rules/graf110.ts +17 -0
- package/dist/rules/grafana-helpers.ts +13 -3
- package/dist/schema/azuremonitor.gen.d.ts +354 -0
- package/dist/schema/azuremonitor.gen.d.ts.map +1 -0
- package/dist/schema/bigquery.gen.d.ts +93 -0
- package/dist/schema/bigquery.gen.d.ts.map +1 -0
- package/dist/schema/cloudwatch.gen.d.ts +394 -0
- package/dist/schema/cloudwatch.gen.d.ts.map +1 -0
- package/dist/schema/elasticsearch.gen.d.ts +444 -0
- package/dist/schema/elasticsearch.gen.d.ts.map +1 -0
- package/dist/schema/googlecloudmonitoring.gen.d.ts +312 -0
- package/dist/schema/googlecloudmonitoring.gen.d.ts.map +1 -0
- package/dist/schema/grafanapyroscope.gen.d.ts +60 -0
- package/dist/schema/grafanapyroscope.gen.d.ts.map +1 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/table.gen.d.ts +13 -0
- package/dist/schema/table.gen.d.ts.map +1 -1
- package/dist/schema-validate.d.ts +9 -0
- package/dist/schema-validate.d.ts.map +1 -1
- package/dist/skill-defs.d.ts.map +1 -1
- package/dist/skills/chant-grafana-operations.md +108 -0
- package/dist/skills/chant-grafana.md +5 -4
- package/dist/spec/schemas.d.ts +9 -7
- package/dist/spec/schemas.d.ts.map +1 -1
- package/dist/spec/schemas.gen.d.ts +3 -0
- package/dist/spec/schemas.gen.d.ts.map +1 -0
- package/dist/validate-alerting.d.ts.map +1 -1
- package/dist/validate-output.d.ts +15 -2
- package/dist/validate-output.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validation.d.ts +14 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/variables.d.ts +102 -5
- package/dist/variables.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/annotations.ts +84 -0
- package/src/api/apply.test.ts +19 -1
- package/src/api/apply.ts +18 -8
- package/src/api/fake-grafana.ts +6 -2
- package/src/api/folders.ts +106 -32
- package/src/build.test.ts +142 -6
- package/src/build.ts +126 -24
- package/src/catalog.ts +20 -2
- package/src/codegen/docs.ts +13 -6
- package/src/codegen/generate.ts +27 -1
- package/src/composites/shared.ts +3 -2
- package/src/dashboard.ts +59 -14
- package/src/datasource-refs.ts +30 -6
- package/src/datasource-settings.test.ts +106 -0
- package/src/datasource-settings.ts +941 -0
- package/src/datasource.ts +71 -11
- package/src/deep-observe-hooks.ts +16 -1
- package/src/deep-observe.test.ts +47 -1
- package/src/deep-observe.ts +36 -13
- package/src/describe-resources.test.ts +16 -0
- package/src/describe-resources.ts +36 -1
- package/src/detect.ts +3 -3
- package/src/folder.ts +118 -0
- package/src/generated/lexicon-grafana.json +70 -0
- package/src/import/generated-types.e2e.test.ts +15 -3
- package/src/import/generator.ts +2 -1
- package/src/import/mappings.ts +98 -26
- package/src/import/model.ts +7 -0
- package/src/import/normalize.ts +32 -3
- package/src/import/parser.test.ts +97 -21
- package/src/import/parser.ts +169 -18
- package/src/import/roundtrip.test.ts +104 -9
- package/src/import/testdata/fixtures.ts +8 -0
- package/src/import/v2.ts +4 -3
- package/src/index.ts +122 -13
- package/src/init-templates.test.ts +74 -0
- package/src/init-templates.ts +349 -0
- package/src/lint/audit-catalog.ts +9 -1
- package/src/lint/post-synth/graf101.ts +2 -2
- package/src/lint/post-synth/graf104.ts +3 -3
- package/src/lint/post-synth/graf106.ts +3 -3
- package/src/lint/post-synth/graf110.ts +17 -0
- package/src/lint/post-synth/grafana-helpers.ts +13 -3
- package/src/lint/post-synth/index.ts +2 -0
- package/src/lint/post-synth/post-synth.test.ts +99 -2
- package/src/load-cost.test.ts +35 -0
- package/src/op/activities/grafana-apply.e2e.test.ts +14 -5
- package/src/op/activities/grafana-apply.test.ts +16 -2
- package/src/op/activities/grafana-apply.ts +29 -3
- package/src/op/activities/index.ts +1 -1
- package/src/ownership.ts +19 -0
- package/src/panels.test.ts +3 -1
- package/src/pin.ts +12 -0
- package/src/plugin.test.ts +9 -2
- package/src/plugin.ts +9 -0
- package/src/promql-check.ts +5 -1
- package/src/query-models.ts +94 -0
- package/src/query.test.ts +166 -0
- package/src/query.ts +177 -12
- package/src/schema/azuremonitor.gen.ts +381 -0
- package/src/schema/bigquery.gen.ts +110 -0
- package/src/schema/cloudwatch.gen.ts +423 -0
- package/src/schema/elasticsearch.gen.ts +508 -0
- package/src/schema/googlecloudmonitoring.gen.ts +330 -0
- package/src/schema/grafanapyroscope.gen.ts +66 -0
- package/src/schema/index.ts +6 -0
- package/src/schema/table.gen.ts +14 -0
- package/src/schema-validate.ts +58 -7
- package/src/skill-defs.ts +17 -0
- package/src/skills/chant-grafana-operations.md +108 -0
- package/src/skills/chant-grafana.md +5 -4
- package/src/spec/overlay/table.overlay.json +19 -0
- package/src/spec/schemas/azuremonitor.jsonschema.json +679 -0
- package/src/spec/schemas/bigquery.jsonschema.json +290 -0
- package/src/spec/schemas/cloudwatch.jsonschema.json +721 -0
- package/src/spec/schemas/elasticsearch.jsonschema.json +1695 -0
- package/src/spec/schemas/googlecloudmonitoring.jsonschema.json +488 -0
- package/src/spec/schemas/grafanapyroscope.jsonschema.json +93 -0
- package/src/spec/schemas.gen.ts +40 -0
- package/src/spec/schemas.ts +9 -7
- package/src/validate-alerting.ts +4 -2
- package/src/validate-output.ts +96 -4
- package/src/validate.ts +14 -0
- package/src/validation.ts +27 -0
- package/src/variables.ts +113 -6
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
// Code generated by chant generate from the vendored Grafana schema
|
|
2
|
+
// src/spec/schemas/elasticsearch.jsonschema.json (see src/pin.ts) and its correction
|
|
3
|
+
// overlay in src/spec/overlay/ (see src/spec/overlay.ts). DO NOT EDIT.
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
|
|
6
|
+
export type BucketAggregation = DateHistogram | Histogram | Terms | Filters | GeoHashGrid | Nested;
|
|
7
|
+
|
|
8
|
+
export interface DateHistogram {
|
|
9
|
+
field?: string;
|
|
10
|
+
id: string;
|
|
11
|
+
type: BucketAggregationType;
|
|
12
|
+
settings?: {
|
|
13
|
+
interval?: string;
|
|
14
|
+
min_doc_count?: string;
|
|
15
|
+
trimEdges?: string;
|
|
16
|
+
offset?: string;
|
|
17
|
+
timeZone?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type BucketAggregationType = "terms" | "filters" | "geohash_grid" | "date_histogram" | "histogram" | "nested";
|
|
22
|
+
|
|
23
|
+
export interface Histogram {
|
|
24
|
+
field?: string;
|
|
25
|
+
id: string;
|
|
26
|
+
type: BucketAggregationType;
|
|
27
|
+
settings?: {
|
|
28
|
+
interval?: string;
|
|
29
|
+
min_doc_count?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface Terms {
|
|
34
|
+
field?: string;
|
|
35
|
+
id: string;
|
|
36
|
+
type: BucketAggregationType;
|
|
37
|
+
settings?: {
|
|
38
|
+
order?: TermsOrder;
|
|
39
|
+
size?: string;
|
|
40
|
+
min_doc_count?: string;
|
|
41
|
+
orderBy?: string;
|
|
42
|
+
missing?: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type TermsOrder = "desc" | "asc";
|
|
47
|
+
|
|
48
|
+
export interface Filters {
|
|
49
|
+
id: string;
|
|
50
|
+
type: BucketAggregationType;
|
|
51
|
+
settings?: {
|
|
52
|
+
filters?: Filter[];
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface Filter {
|
|
57
|
+
query: string;
|
|
58
|
+
label: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface GeoHashGrid {
|
|
62
|
+
field?: string;
|
|
63
|
+
id: string;
|
|
64
|
+
type: BucketAggregationType;
|
|
65
|
+
settings?: {
|
|
66
|
+
precision?: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface Nested {
|
|
71
|
+
field?: string;
|
|
72
|
+
id: string;
|
|
73
|
+
type: BucketAggregationType;
|
|
74
|
+
settings?: Record<string, unknown>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type MetricAggregation = Count | PipelineMetricAggregation | MetricAggregationWithSettings;
|
|
78
|
+
|
|
79
|
+
export interface Count {
|
|
80
|
+
type: MetricAggregationType;
|
|
81
|
+
id: string;
|
|
82
|
+
hide?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type MetricAggregationType = "count" | "avg" | "sum" | "min" | "max" | "extended_stats" | "percentiles" | "cardinality" | "raw_document" | "raw_data" | "logs" | "rate" | "top_metrics" | PipelineMetricAggregationType;
|
|
86
|
+
|
|
87
|
+
export type PipelineMetricAggregationType = "moving_avg" | "moving_fn" | "derivative" | "serial_diff" | "cumulative_sum" | "bucket_script";
|
|
88
|
+
|
|
89
|
+
export type PipelineMetricAggregation = MovingAverage | Derivative | CumulativeSum | BucketScript;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* #MovingAverage's settings are overridden in types.ts
|
|
93
|
+
*/
|
|
94
|
+
export interface MovingAverage {
|
|
95
|
+
pipelineAgg?: string;
|
|
96
|
+
field?: string;
|
|
97
|
+
type: MetricAggregationType;
|
|
98
|
+
id: string;
|
|
99
|
+
settings?: Record<string, Record<string, unknown>>;
|
|
100
|
+
hide?: boolean;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface Derivative {
|
|
104
|
+
pipelineAgg?: string;
|
|
105
|
+
field?: string;
|
|
106
|
+
type: MetricAggregationType;
|
|
107
|
+
id: string;
|
|
108
|
+
settings?: {
|
|
109
|
+
unit?: string;
|
|
110
|
+
};
|
|
111
|
+
hide?: boolean;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface CumulativeSum {
|
|
115
|
+
pipelineAgg?: string;
|
|
116
|
+
field?: string;
|
|
117
|
+
type: MetricAggregationType;
|
|
118
|
+
id: string;
|
|
119
|
+
settings?: {
|
|
120
|
+
format?: string;
|
|
121
|
+
};
|
|
122
|
+
hide?: boolean;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface BucketScript {
|
|
126
|
+
type: MetricAggregationType;
|
|
127
|
+
pipelineVariables?: PipelineVariable[];
|
|
128
|
+
id: string;
|
|
129
|
+
settings?: {
|
|
130
|
+
script?: InlineScript;
|
|
131
|
+
};
|
|
132
|
+
hide?: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface PipelineVariable {
|
|
136
|
+
name: string;
|
|
137
|
+
pipelineAgg: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type InlineScript = string | {
|
|
141
|
+
inline?: string;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type MetricAggregationWithSettings = BucketScript | CumulativeSum | Derivative | SerialDiff | RawData | RawDocument | UniqueCount | Percentiles | ExtendedStats | Min | Max | Sum | Average | MovingAverage | MovingFunction | Logs | Rate | TopMetrics;
|
|
145
|
+
|
|
146
|
+
export interface SerialDiff {
|
|
147
|
+
pipelineAgg?: string;
|
|
148
|
+
field?: string;
|
|
149
|
+
type: MetricAggregationType;
|
|
150
|
+
id: string;
|
|
151
|
+
settings?: {
|
|
152
|
+
lag?: string;
|
|
153
|
+
};
|
|
154
|
+
hide?: boolean;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface RawData {
|
|
158
|
+
type: MetricAggregationType;
|
|
159
|
+
id: string;
|
|
160
|
+
settings?: {
|
|
161
|
+
size?: string;
|
|
162
|
+
};
|
|
163
|
+
hide?: boolean;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface RawDocument {
|
|
167
|
+
type: MetricAggregationType;
|
|
168
|
+
id: string;
|
|
169
|
+
settings?: {
|
|
170
|
+
size?: string;
|
|
171
|
+
};
|
|
172
|
+
hide?: boolean;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface UniqueCount {
|
|
176
|
+
type: MetricAggregationType;
|
|
177
|
+
field?: string;
|
|
178
|
+
id: string;
|
|
179
|
+
settings?: {
|
|
180
|
+
precision_threshold?: string;
|
|
181
|
+
missing?: string;
|
|
182
|
+
};
|
|
183
|
+
hide?: boolean;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface Percentiles {
|
|
187
|
+
type: MetricAggregationType;
|
|
188
|
+
field?: string;
|
|
189
|
+
id: string;
|
|
190
|
+
settings?: {
|
|
191
|
+
script?: InlineScript;
|
|
192
|
+
missing?: string;
|
|
193
|
+
percents?: string[];
|
|
194
|
+
};
|
|
195
|
+
hide?: boolean;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface ExtendedStats {
|
|
199
|
+
type: MetricAggregationType;
|
|
200
|
+
settings?: {
|
|
201
|
+
script?: InlineScript;
|
|
202
|
+
missing?: string;
|
|
203
|
+
sigma?: string;
|
|
204
|
+
};
|
|
205
|
+
field?: string;
|
|
206
|
+
id: string;
|
|
207
|
+
meta?: Record<string, unknown>;
|
|
208
|
+
hide?: boolean;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface Min {
|
|
212
|
+
type: MetricAggregationType;
|
|
213
|
+
field?: string;
|
|
214
|
+
id: string;
|
|
215
|
+
settings?: {
|
|
216
|
+
script?: InlineScript;
|
|
217
|
+
missing?: string;
|
|
218
|
+
};
|
|
219
|
+
hide?: boolean;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface Max {
|
|
223
|
+
type: MetricAggregationType;
|
|
224
|
+
field?: string;
|
|
225
|
+
id: string;
|
|
226
|
+
settings?: {
|
|
227
|
+
script?: InlineScript;
|
|
228
|
+
missing?: string;
|
|
229
|
+
};
|
|
230
|
+
hide?: boolean;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface Sum {
|
|
234
|
+
type: MetricAggregationType;
|
|
235
|
+
field?: string;
|
|
236
|
+
id: string;
|
|
237
|
+
settings?: {
|
|
238
|
+
script?: InlineScript;
|
|
239
|
+
missing?: string;
|
|
240
|
+
};
|
|
241
|
+
hide?: boolean;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface Average {
|
|
245
|
+
type: MetricAggregationType;
|
|
246
|
+
field?: string;
|
|
247
|
+
id: string;
|
|
248
|
+
settings?: {
|
|
249
|
+
script?: InlineScript;
|
|
250
|
+
missing?: string;
|
|
251
|
+
};
|
|
252
|
+
hide?: boolean;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface MovingFunction {
|
|
256
|
+
pipelineAgg?: string;
|
|
257
|
+
field?: string;
|
|
258
|
+
type: MetricAggregationType;
|
|
259
|
+
id: string;
|
|
260
|
+
settings?: {
|
|
261
|
+
window?: string;
|
|
262
|
+
script?: InlineScript;
|
|
263
|
+
shift?: string;
|
|
264
|
+
};
|
|
265
|
+
hide?: boolean;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface Logs {
|
|
269
|
+
type: MetricAggregationType;
|
|
270
|
+
id: string;
|
|
271
|
+
settings?: {
|
|
272
|
+
limit?: string;
|
|
273
|
+
};
|
|
274
|
+
hide?: boolean;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface Rate {
|
|
278
|
+
type: MetricAggregationType;
|
|
279
|
+
field?: string;
|
|
280
|
+
id: string;
|
|
281
|
+
settings?: {
|
|
282
|
+
unit?: string;
|
|
283
|
+
mode?: string;
|
|
284
|
+
};
|
|
285
|
+
hide?: boolean;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface TopMetrics {
|
|
289
|
+
type: MetricAggregationType;
|
|
290
|
+
id: string;
|
|
291
|
+
settings?: {
|
|
292
|
+
order?: string;
|
|
293
|
+
orderBy?: string;
|
|
294
|
+
metrics?: string[];
|
|
295
|
+
};
|
|
296
|
+
hide?: boolean;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface BaseBucketAggregation {
|
|
300
|
+
id: string;
|
|
301
|
+
type: BucketAggregationType;
|
|
302
|
+
settings?: Record<string, unknown>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface BucketAggregationWithField {
|
|
306
|
+
field?: string;
|
|
307
|
+
id: string;
|
|
308
|
+
type: BucketAggregationType;
|
|
309
|
+
settings?: Record<string, unknown>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface DateHistogramSettings {
|
|
313
|
+
interval?: string;
|
|
314
|
+
min_doc_count?: string;
|
|
315
|
+
trimEdges?: string;
|
|
316
|
+
offset?: string;
|
|
317
|
+
timeZone?: string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface HistogramSettings {
|
|
321
|
+
interval?: string;
|
|
322
|
+
min_doc_count?: string;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export interface TermsSettings {
|
|
326
|
+
order?: TermsOrder;
|
|
327
|
+
size?: string;
|
|
328
|
+
min_doc_count?: string;
|
|
329
|
+
orderBy?: string;
|
|
330
|
+
missing?: string;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export interface FiltersSettings {
|
|
334
|
+
filters?: Filter[];
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export interface GeoHashGridSettings {
|
|
338
|
+
precision?: string;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export interface BaseMetricAggregation {
|
|
342
|
+
type: MetricAggregationType;
|
|
343
|
+
id: string;
|
|
344
|
+
hide?: boolean;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export interface MetricAggregationWithField {
|
|
348
|
+
field?: string;
|
|
349
|
+
type: MetricAggregationType;
|
|
350
|
+
id: string;
|
|
351
|
+
hide?: boolean;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface MetricAggregationWithMissingSupport {
|
|
355
|
+
settings?: {
|
|
356
|
+
missing?: string;
|
|
357
|
+
};
|
|
358
|
+
type: MetricAggregationType;
|
|
359
|
+
id: string;
|
|
360
|
+
hide?: boolean;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export interface MetricAggregationWithInlineScript {
|
|
364
|
+
settings?: {
|
|
365
|
+
script?: InlineScript;
|
|
366
|
+
};
|
|
367
|
+
type: MetricAggregationType;
|
|
368
|
+
id: string;
|
|
369
|
+
hide?: boolean;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export type ExtendedStatMetaType = "avg" | "min" | "max" | "sum" | "count" | "std_deviation" | "std_deviation_bounds_upper" | "std_deviation_bounds_lower";
|
|
373
|
+
|
|
374
|
+
export interface ExtendedStat {
|
|
375
|
+
label: string;
|
|
376
|
+
value: ExtendedStatMetaType;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface BasePipelineMetricAggregation {
|
|
380
|
+
pipelineAgg?: string;
|
|
381
|
+
field?: string;
|
|
382
|
+
type: string;
|
|
383
|
+
id: string;
|
|
384
|
+
hide?: boolean;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export interface PipelineMetricAggregationWithMultipleBucketPaths {
|
|
388
|
+
pipelineVariables?: PipelineVariable[];
|
|
389
|
+
type: MetricAggregationType;
|
|
390
|
+
id: string;
|
|
391
|
+
hide?: boolean;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export type MovingAverageModel = "simple" | "linear" | "ewma" | "holt" | "holt_winters";
|
|
395
|
+
|
|
396
|
+
export interface MovingAverageModelOption {
|
|
397
|
+
label: string;
|
|
398
|
+
value: MovingAverageModel;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export interface BaseMovingAverageModelSettings {
|
|
402
|
+
model: MovingAverageModel;
|
|
403
|
+
window: string;
|
|
404
|
+
predict: string;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface MovingAverageSimpleModelSettings {
|
|
408
|
+
model: MovingAverageModel;
|
|
409
|
+
window: string;
|
|
410
|
+
predict: string;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface MovingAverageLinearModelSettings {
|
|
414
|
+
model: MovingAverageModel;
|
|
415
|
+
window: string;
|
|
416
|
+
predict: string;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export interface MovingAverageEWMAModelSettings {
|
|
420
|
+
model: MovingAverageModel;
|
|
421
|
+
settings?: {
|
|
422
|
+
alpha?: string;
|
|
423
|
+
};
|
|
424
|
+
window: string;
|
|
425
|
+
minimize: boolean;
|
|
426
|
+
predict: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export interface MovingAverageHoltModelSettings {
|
|
430
|
+
model: MovingAverageModel;
|
|
431
|
+
settings: {
|
|
432
|
+
alpha?: string;
|
|
433
|
+
beta?: string;
|
|
434
|
+
};
|
|
435
|
+
window: string;
|
|
436
|
+
minimize: boolean;
|
|
437
|
+
predict: string;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export interface MovingAverageHoltWintersModelSettings {
|
|
441
|
+
model: MovingAverageModel;
|
|
442
|
+
settings: {
|
|
443
|
+
alpha?: string;
|
|
444
|
+
beta?: string;
|
|
445
|
+
gamma?: string;
|
|
446
|
+
period?: string;
|
|
447
|
+
pad?: boolean;
|
|
448
|
+
};
|
|
449
|
+
window: string;
|
|
450
|
+
minimize: boolean;
|
|
451
|
+
predict: string;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export interface Dataquery {
|
|
455
|
+
/**
|
|
456
|
+
* Alias pattern
|
|
457
|
+
*/
|
|
458
|
+
alias?: string;
|
|
459
|
+
/**
|
|
460
|
+
* Lucene query
|
|
461
|
+
*/
|
|
462
|
+
query?: string;
|
|
463
|
+
/**
|
|
464
|
+
* Name of time field
|
|
465
|
+
*/
|
|
466
|
+
timeField?: string;
|
|
467
|
+
/**
|
|
468
|
+
* List of bucket aggregations
|
|
469
|
+
*/
|
|
470
|
+
bucketAggs?: BucketAggregation[];
|
|
471
|
+
/**
|
|
472
|
+
* List of metric aggregations
|
|
473
|
+
*/
|
|
474
|
+
metrics?: MetricAggregation[];
|
|
475
|
+
/**
|
|
476
|
+
* A unique identifier for the query within the list of targets.
|
|
477
|
+
* In server side expressions, the refId is used as a variable name to identify results.
|
|
478
|
+
* By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
|
479
|
+
*/
|
|
480
|
+
refId?: string | null;
|
|
481
|
+
/**
|
|
482
|
+
* If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.
|
|
483
|
+
*/
|
|
484
|
+
hide?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* Specify the query flavor
|
|
487
|
+
* TODO make this required and give it a default
|
|
488
|
+
*/
|
|
489
|
+
queryType?: string;
|
|
490
|
+
/**
|
|
491
|
+
* For mixed data sources the selected datasource is on the query level.
|
|
492
|
+
* For non mixed scenarios this is undefined.
|
|
493
|
+
* TODO find a better way to do this ^ that's friendly to schema
|
|
494
|
+
* TODO this shouldn't be unknown but DataSourceRef | null
|
|
495
|
+
*/
|
|
496
|
+
datasource?: DataSourceRef;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export interface DataSourceRef {
|
|
500
|
+
/**
|
|
501
|
+
* The plugin type-id
|
|
502
|
+
*/
|
|
503
|
+
type?: string;
|
|
504
|
+
/**
|
|
505
|
+
* Specific datasource instance
|
|
506
|
+
*/
|
|
507
|
+
uid?: string;
|
|
508
|
+
}
|