@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,312 @@
|
|
|
1
|
+
export interface CloudMonitoringQuery {
|
|
2
|
+
/**
|
|
3
|
+
* A unique identifier for the query within the list of targets.
|
|
4
|
+
* In server side expressions, the refId is used as a variable name to identify results.
|
|
5
|
+
* By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
|
6
|
+
*/
|
|
7
|
+
refId?: string | null;
|
|
8
|
+
/**
|
|
9
|
+
* If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.
|
|
10
|
+
*/
|
|
11
|
+
hide?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Specify the query flavor
|
|
14
|
+
* TODO make this required and give it a default
|
|
15
|
+
*/
|
|
16
|
+
queryType?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Aliases can be set to modify the legend labels. e.g. {{metric.label.xxx}}. See docs for more detail.
|
|
19
|
+
*/
|
|
20
|
+
aliasBy?: string;
|
|
21
|
+
/**
|
|
22
|
+
* GCM query type.
|
|
23
|
+
* queryType: #QueryType
|
|
24
|
+
* Time Series List sub-query properties.
|
|
25
|
+
*/
|
|
26
|
+
timeSeriesList?: TimeSeriesList;
|
|
27
|
+
/**
|
|
28
|
+
* Time Series sub-query properties.
|
|
29
|
+
*/
|
|
30
|
+
timeSeriesQuery?: TimeSeriesQuery;
|
|
31
|
+
/**
|
|
32
|
+
* SLO sub-query properties.
|
|
33
|
+
*/
|
|
34
|
+
sloQuery?: SLOQuery;
|
|
35
|
+
/**
|
|
36
|
+
* PromQL sub-query properties.
|
|
37
|
+
*/
|
|
38
|
+
promQLQuery?: PromQLQuery;
|
|
39
|
+
/**
|
|
40
|
+
* For mixed data sources the selected datasource is on the query level.
|
|
41
|
+
* For non mixed scenarios this is undefined.
|
|
42
|
+
* TODO find a better way to do this ^ that's friendly to schema
|
|
43
|
+
* TODO this shouldn't be unknown but DataSourceRef | null
|
|
44
|
+
*/
|
|
45
|
+
datasource?: DataSourceRef;
|
|
46
|
+
/**
|
|
47
|
+
* Time interval in milliseconds.
|
|
48
|
+
*/
|
|
49
|
+
intervalMs?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Time Series List sub-query properties.
|
|
53
|
+
*/
|
|
54
|
+
export interface TimeSeriesList {
|
|
55
|
+
/**
|
|
56
|
+
* GCP project to execute the query against.
|
|
57
|
+
*/
|
|
58
|
+
projectName: string;
|
|
59
|
+
/**
|
|
60
|
+
* Reducer applied across a set of time-series values. Defaults to REDUCE_NONE.
|
|
61
|
+
*/
|
|
62
|
+
crossSeriesReducer: string;
|
|
63
|
+
/**
|
|
64
|
+
* Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto.
|
|
65
|
+
*/
|
|
66
|
+
alignmentPeriod?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Alignment function to be used. Defaults to ALIGN_MEAN.
|
|
69
|
+
*/
|
|
70
|
+
perSeriesAligner?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Array of labels to group data by.
|
|
73
|
+
*/
|
|
74
|
+
groupBys?: string[];
|
|
75
|
+
/**
|
|
76
|
+
* Array of filters to query data by. Labels that can be filtered on are defined by the metric.
|
|
77
|
+
*/
|
|
78
|
+
filters?: string[];
|
|
79
|
+
/**
|
|
80
|
+
* Data view, defaults to FULL.
|
|
81
|
+
*/
|
|
82
|
+
view?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Annotation title.
|
|
85
|
+
*/
|
|
86
|
+
title?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Annotation text.
|
|
89
|
+
*/
|
|
90
|
+
text?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Only present if a preprocessor is selected. Reducer applied across a set of time-series values. Defaults to REDUCE_NONE.
|
|
93
|
+
*/
|
|
94
|
+
secondaryCrossSeriesReducer?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Only present if a preprocessor is selected. Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto.
|
|
97
|
+
*/
|
|
98
|
+
secondaryAlignmentPeriod?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Only present if a preprocessor is selected. Alignment function to be used. Defaults to ALIGN_MEAN.
|
|
101
|
+
*/
|
|
102
|
+
secondaryPerSeriesAligner?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Only present if a preprocessor is selected. Array of labels to group data by.
|
|
105
|
+
*/
|
|
106
|
+
secondaryGroupBys?: string[];
|
|
107
|
+
/**
|
|
108
|
+
* Preprocessor is not part of the API, but is used to store the preprocessor and not affect the UI for the rest of parameters
|
|
109
|
+
*/
|
|
110
|
+
preprocessor?: PreprocessorType;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Types of pre-processor available. Defined by the metric.
|
|
114
|
+
*/
|
|
115
|
+
export type PreprocessorType = "none" | "rate" | "delta";
|
|
116
|
+
/**
|
|
117
|
+
* Time Series sub-query properties.
|
|
118
|
+
*/
|
|
119
|
+
export interface TimeSeriesQuery {
|
|
120
|
+
/**
|
|
121
|
+
* GCP project to execute the query against.
|
|
122
|
+
*/
|
|
123
|
+
projectName: string;
|
|
124
|
+
/**
|
|
125
|
+
* MQL query to be executed.
|
|
126
|
+
*/
|
|
127
|
+
query: string;
|
|
128
|
+
/**
|
|
129
|
+
* To disable the graphPeriod, it should explictly be set to 'disabled'.
|
|
130
|
+
*/
|
|
131
|
+
graphPeriod?: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* SLO sub-query properties.
|
|
135
|
+
*/
|
|
136
|
+
export interface SLOQuery {
|
|
137
|
+
/**
|
|
138
|
+
* GCP project to execute the query against.
|
|
139
|
+
*/
|
|
140
|
+
projectName: string;
|
|
141
|
+
/**
|
|
142
|
+
* Alignment function to be used. Defaults to ALIGN_MEAN.
|
|
143
|
+
*/
|
|
144
|
+
perSeriesAligner?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto.
|
|
147
|
+
*/
|
|
148
|
+
alignmentPeriod?: string;
|
|
149
|
+
/**
|
|
150
|
+
* SLO selector.
|
|
151
|
+
*/
|
|
152
|
+
selectorName: string;
|
|
153
|
+
/**
|
|
154
|
+
* ID for the service the SLO is in.
|
|
155
|
+
*/
|
|
156
|
+
serviceId: string;
|
|
157
|
+
/**
|
|
158
|
+
* Name for the service the SLO is in.
|
|
159
|
+
*/
|
|
160
|
+
serviceName: string;
|
|
161
|
+
/**
|
|
162
|
+
* ID for the SLO.
|
|
163
|
+
*/
|
|
164
|
+
sloId: string;
|
|
165
|
+
/**
|
|
166
|
+
* Name of the SLO.
|
|
167
|
+
*/
|
|
168
|
+
sloName: string;
|
|
169
|
+
/**
|
|
170
|
+
* SLO goal value.
|
|
171
|
+
*/
|
|
172
|
+
goal?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Specific lookback period for the SLO.
|
|
175
|
+
*/
|
|
176
|
+
lookbackPeriod?: string;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* PromQL sub-query properties.
|
|
180
|
+
*/
|
|
181
|
+
export interface PromQLQuery {
|
|
182
|
+
/**
|
|
183
|
+
* GCP project to execute the query against.
|
|
184
|
+
*/
|
|
185
|
+
projectName: string;
|
|
186
|
+
/**
|
|
187
|
+
* PromQL expression/query to be executed.
|
|
188
|
+
*/
|
|
189
|
+
expr: string;
|
|
190
|
+
/**
|
|
191
|
+
* PromQL min step
|
|
192
|
+
*/
|
|
193
|
+
step: string;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Defines the supported queryTypes.
|
|
197
|
+
*/
|
|
198
|
+
export type QueryType = "timeSeriesList" | "timeSeriesQuery" | "slo" | "annotation" | "promQL";
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated This type is for migration purposes only. Replaced by TimeSeriesList Metric sub-query properties.
|
|
201
|
+
*/
|
|
202
|
+
export interface MetricQuery {
|
|
203
|
+
/**
|
|
204
|
+
* GCP project to execute the query against.
|
|
205
|
+
*/
|
|
206
|
+
projectName: string;
|
|
207
|
+
/**
|
|
208
|
+
* Alignment function to be used. Defaults to ALIGN_MEAN.
|
|
209
|
+
*/
|
|
210
|
+
perSeriesAligner?: string;
|
|
211
|
+
/**
|
|
212
|
+
* Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto.
|
|
213
|
+
*/
|
|
214
|
+
alignmentPeriod?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Aliases can be set to modify the legend labels. e.g. {{metric.label.xxx}}. See docs for more detail.
|
|
217
|
+
*/
|
|
218
|
+
aliasBy?: string;
|
|
219
|
+
editorMode: string;
|
|
220
|
+
metricType: string;
|
|
221
|
+
/**
|
|
222
|
+
* Reducer applied across a set of time-series values. Defaults to REDUCE_NONE.
|
|
223
|
+
*/
|
|
224
|
+
crossSeriesReducer: string;
|
|
225
|
+
/**
|
|
226
|
+
* Array of labels to group data by.
|
|
227
|
+
*/
|
|
228
|
+
groupBys?: string[];
|
|
229
|
+
/**
|
|
230
|
+
* Array of filters to query data by. Labels that can be filtered on are defined by the metric.
|
|
231
|
+
*/
|
|
232
|
+
filters?: string[];
|
|
233
|
+
metricKind?: MetricKind;
|
|
234
|
+
valueType?: string;
|
|
235
|
+
view?: string;
|
|
236
|
+
/**
|
|
237
|
+
* MQL query to be executed.
|
|
238
|
+
*/
|
|
239
|
+
query: string;
|
|
240
|
+
/**
|
|
241
|
+
* Preprocessor is not part of the API, but is used to store the preprocessor and not affect the UI for the rest of parameters
|
|
242
|
+
*/
|
|
243
|
+
preprocessor?: PreprocessorType;
|
|
244
|
+
/**
|
|
245
|
+
* To disable the graphPeriod, it should explictly be set to 'disabled'.
|
|
246
|
+
*/
|
|
247
|
+
graphPeriod?: string;
|
|
248
|
+
}
|
|
249
|
+
export type MetricKind = "METRIC_KIND_UNSPECIFIED" | "GAUGE" | "DELTA" | "CUMULATIVE";
|
|
250
|
+
export type ValueTypes = "VALUE_TYPE_UNSPECIFIED" | "BOOL" | "INT64" | "DOUBLE" | "STRING" | "DISTRIBUTION" | "MONEY";
|
|
251
|
+
export type AlignmentTypes = "ALIGN_DELTA" | "ALIGN_RATE" | "ALIGN_INTERPOLATE" | "ALIGN_NEXT_OLDER" | "ALIGN_MIN" | "ALIGN_MAX" | "ALIGN_MEAN" | "ALIGN_COUNT" | "ALIGN_SUM" | "ALIGN_STDDEV" | "ALIGN_COUNT_TRUE" | "ALIGN_COUNT_FALSE" | "ALIGN_FRACTION_TRUE" | "ALIGN_PERCENTILE_99" | "ALIGN_PERCENTILE_95" | "ALIGN_PERCENTILE_50" | "ALIGN_PERCENTILE_05" | "ALIGN_PERCENT_CHANGE" | "ALIGN_NONE";
|
|
252
|
+
/**
|
|
253
|
+
* @deprecated Use TimeSeriesList instead. Legacy annotation query properties for migration purposes.
|
|
254
|
+
*/
|
|
255
|
+
export interface LegacyCloudMonitoringAnnotationQuery {
|
|
256
|
+
/**
|
|
257
|
+
* GCP project to execute the query against.
|
|
258
|
+
*/
|
|
259
|
+
projectName: string;
|
|
260
|
+
metricType: string;
|
|
261
|
+
/**
|
|
262
|
+
* Query refId.
|
|
263
|
+
*/
|
|
264
|
+
refId: string;
|
|
265
|
+
/**
|
|
266
|
+
* Array of filters to query data by. Labels that can be filtered on are defined by the metric.
|
|
267
|
+
*/
|
|
268
|
+
filters: string[];
|
|
269
|
+
metricKind: MetricKind;
|
|
270
|
+
valueType: string;
|
|
271
|
+
/**
|
|
272
|
+
* Annotation title.
|
|
273
|
+
*/
|
|
274
|
+
title: string;
|
|
275
|
+
/**
|
|
276
|
+
* Annotation text.
|
|
277
|
+
*/
|
|
278
|
+
text: string;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Query filter representation.
|
|
282
|
+
*/
|
|
283
|
+
export interface Filter {
|
|
284
|
+
/**
|
|
285
|
+
* Filter key.
|
|
286
|
+
*/
|
|
287
|
+
key: string;
|
|
288
|
+
/**
|
|
289
|
+
* Filter operator.
|
|
290
|
+
*/
|
|
291
|
+
operator: string;
|
|
292
|
+
/**
|
|
293
|
+
* Filter value.
|
|
294
|
+
*/
|
|
295
|
+
value: string;
|
|
296
|
+
/**
|
|
297
|
+
* Filter condition.
|
|
298
|
+
*/
|
|
299
|
+
condition?: string;
|
|
300
|
+
}
|
|
301
|
+
export type MetricFindQueryTypes = "projects" | "services" | "defaultProject" | "metricTypes" | "labelKeys" | "labelValues" | "resourceTypes" | "aggregations" | "aligners" | "alignmentPeriods" | "selectors" | "sloServices" | "slo";
|
|
302
|
+
export interface DataSourceRef {
|
|
303
|
+
/**
|
|
304
|
+
* The plugin type-id
|
|
305
|
+
*/
|
|
306
|
+
type?: string;
|
|
307
|
+
/**
|
|
308
|
+
* Specific datasource instance
|
|
309
|
+
*/
|
|
310
|
+
uid?: string;
|
|
311
|
+
}
|
|
312
|
+
//# sourceMappingURL=googlecloudmonitoring.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"googlecloudmonitoring.gen.d.ts","sourceRoot":"","sources":["../../src/schema/googlecloudmonitoring.gen.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;OAKG;IACH,UAAU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AAG,cAAc,GAAG,UAAU,GAAG,kBAAkB,GAAG,WAAW,GAAG,aAAa,GAAG,KAAK,CAAC;AAEvO,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type PyroscopeQueryType = "metrics" | "profile" | "both";
|
|
2
|
+
export interface Dataquery {
|
|
3
|
+
/**
|
|
4
|
+
* Specifies the query label selectors.
|
|
5
|
+
*/
|
|
6
|
+
labelSelector: string;
|
|
7
|
+
/**
|
|
8
|
+
* Specifies the query span selectors.
|
|
9
|
+
*/
|
|
10
|
+
spanSelector?: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Specifies the type of profile to query.
|
|
13
|
+
*/
|
|
14
|
+
profileTypeId: string;
|
|
15
|
+
/**
|
|
16
|
+
* Allows to group the results.
|
|
17
|
+
*/
|
|
18
|
+
groupBy: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Sets the maximum number of time series.
|
|
21
|
+
*/
|
|
22
|
+
limit?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the maximum number of nodes in the flamegraph.
|
|
25
|
+
*/
|
|
26
|
+
maxNodes?: number;
|
|
27
|
+
/**
|
|
28
|
+
* A unique identifier for the query within the list of targets.
|
|
29
|
+
* In server side expressions, the refId is used as a variable name to identify results.
|
|
30
|
+
* By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
|
31
|
+
*/
|
|
32
|
+
refId?: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.
|
|
35
|
+
*/
|
|
36
|
+
hide?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Specify the query flavor
|
|
39
|
+
* TODO make this required and give it a default
|
|
40
|
+
*/
|
|
41
|
+
queryType?: string;
|
|
42
|
+
/**
|
|
43
|
+
* For mixed data sources the selected datasource is on the query level.
|
|
44
|
+
* For non mixed scenarios this is undefined.
|
|
45
|
+
* TODO find a better way to do this ^ that's friendly to schema
|
|
46
|
+
* TODO this shouldn't be unknown but DataSourceRef | null
|
|
47
|
+
*/
|
|
48
|
+
datasource?: DataSourceRef;
|
|
49
|
+
}
|
|
50
|
+
export interface DataSourceRef {
|
|
51
|
+
/**
|
|
52
|
+
* The plugin type-id
|
|
53
|
+
*/
|
|
54
|
+
type?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Specific datasource instance
|
|
57
|
+
*/
|
|
58
|
+
uid?: string;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=grafanapyroscope.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grafanapyroscope.gen.d.ts","sourceRoot":"","sources":["../../src/schema/grafanapyroscope.gen.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhE,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export * as geomap from "./geomap.gen.js";
|
|
|
25
25
|
export * as prometheus from "./prometheus.gen.js";
|
|
26
26
|
export * as tempo from "./tempo.gen.js";
|
|
27
27
|
export * as loki from "./loki.gen.js";
|
|
28
|
+
export * as elasticsearch from "./elasticsearch.gen.js";
|
|
29
|
+
export * as cloudwatch from "./cloudwatch.gen.js";
|
|
30
|
+
export * as azuremonitor from "./azuremonitor.gen.js";
|
|
31
|
+
export * as googlecloudmonitoring from "./googlecloudmonitoring.gen.js";
|
|
32
|
+
export * as bigquery from "./bigquery.gen.js";
|
|
33
|
+
export * as grafanapyroscope from "./grafanapyroscope.gen.js";
|
|
28
34
|
export * as expr from "./expr.gen.js";
|
|
29
35
|
export { DASHBOARD_SCHEMA_VERSION } from "./dashboard.gen.js";
|
|
30
36
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,aAAa,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AK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,qBAAqB,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -78,6 +78,10 @@ export interface TableFieldOptions {
|
|
|
78
78
|
* Hides any header for a column, useful for columns that show some static content or buttons.
|
|
79
79
|
*/
|
|
80
80
|
hideHeader?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* options for the footer for this field
|
|
83
|
+
*/
|
|
84
|
+
footer?: TableFieldFooterOptions;
|
|
81
85
|
}
|
|
82
86
|
/**
|
|
83
87
|
* TODO -- should not be table specific!
|
|
@@ -311,4 +315,13 @@ export interface TableMarkdownCellOptions {
|
|
|
311
315
|
export interface TableGeoCellOptions {
|
|
312
316
|
type: TableCellDisplayMode;
|
|
313
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* The footer of one field (TableFooterOptions in the CUE; renamed here because the vendored schema already has a panel-level TableFooterOptions)
|
|
320
|
+
*/
|
|
321
|
+
export interface TableFieldFooterOptions {
|
|
322
|
+
/**
|
|
323
|
+
* footer reducers to apply to this field
|
|
324
|
+
*/
|
|
325
|
+
reducers?: string[];
|
|
326
|
+
}
|
|
314
327
|
//# sourceMappingURL=table.gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.gen.d.ts","sourceRoot":"","sources":["../../src/schema/table.gen.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IACl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,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEnH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,oBAAoB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,oBAAoB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB"}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* discriminated unions (a table's `cellOptions: { type: "auto" }` matches
|
|
26
26
|
* several variants) match more than one.
|
|
27
27
|
*/
|
|
28
|
+
import type { SchemaName } from "./pin.js";
|
|
28
29
|
export interface SchemaProblem {
|
|
29
30
|
/** JSON pointer into the dashboard. */
|
|
30
31
|
path: string;
|
|
@@ -32,6 +33,14 @@ export interface SchemaProblem {
|
|
|
32
33
|
/** `error` for a value the schema does not allow, `warning` for a key it does not know. */
|
|
33
34
|
severity: "error" | "warning";
|
|
34
35
|
}
|
|
36
|
+
/** Why schema validation cannot run here (ajv did not load), or undefined when it can. */
|
|
37
|
+
export declare function schemaValidationUnavailable(): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* One schema as validation uses it: the vendored file with its overlay
|
|
40
|
+
* applied, from the generated `spec/schemas.gen.ts` (no filesystem read, so
|
|
41
|
+
* it works bundled), parsed on first use.
|
|
42
|
+
*/
|
|
43
|
+
export declare function bundledSchema(name: SchemaName): Record<string, unknown>;
|
|
35
44
|
type Json = Record<string, unknown>;
|
|
36
45
|
/** Everything in one dashboard that the pinned schemas reject or do not know. */
|
|
37
46
|
export declare function validateDashboardSchema(dashboard: Json): SchemaProblem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-validate.d.ts","sourceRoot":"","sources":["../src/schema-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"schema-validate.d.ts","sourceRoot":"","sources":["../src/schema-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAKxC,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B;AA6BD,0FAA0F;AAC1F,wBAAgB,2BAA2B,IAAI,MAAM,GAAG,SAAS,CAGhE;AAUD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOvE;AAoFD,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAwDpC,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,IAAI,GAAG,aAAa,EAAE,CAsBxE;AAYD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,SAAK,GAAG,aAAa,EAAE,CAMlF"}
|
package/dist/skill-defs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-defs.d.ts","sourceRoot":"","sources":["../src/skill-defs.ts"],"names":[],"mappings":"AAEA,8DAA8D;AAC9D,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"skill-defs.d.ts","sourceRoot":"","sources":["../src/skill-defs.ts"],"names":[],"mappings":"AAEA,8DAA8D;AAC9D,eAAO,MAAM,aAAa,qDA6DxB,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill: chant-grafana-operations
|
|
3
|
+
description: Start a Grafana project from a template, bring existing dashboards into chant with chant import, find what changed in a running Grafana with chant lifecycle diff --live, export a Grafana as TypeScript, and apply a build over the HTTP API
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Operating Grafana with chant
|
|
8
|
+
|
|
9
|
+
Use this skill when a Grafana already exists: dashboards made in the UI to bring under chant, a provisioned dashboard somebody edited, or a build to push without mounting files. For writing dashboards see the chant-grafana skill; for provisioning files and ConfigMaps, chant-grafana-provisioning; for alert rules, chant-grafana-alerting.
|
|
10
|
+
|
|
11
|
+
## Start a project
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
chant init --lexicon grafana my-dashboards # a Prometheus datasource and one dashboard
|
|
15
|
+
chant init --lexicon grafana --template red my-dashboards # RedDashboard over span metrics, ExternalDatasource, Folder
|
|
16
|
+
chant init --lexicon grafana --template k8s-pods my-dashboards # pod dashboard delivered as sidecar ConfigMaps (k8s + grafana)
|
|
17
|
+
chant init --lexicon grafana --template slo my-dashboards # Slo rules, SloDashboard and SloAlertRules (prometheus + grafana)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Every template builds clean and passes the GRAF checks as written. `k8s-pods` and `slo` ship a `chant.config.ts` naming both lexicons and a `build` script without `--lexicon`, so both outputs and both lexicons' checks run.
|
|
21
|
+
|
|
22
|
+
## Import dashboards you already have
|
|
23
|
+
|
|
24
|
+
Export the dashboard in Grafana (Export > Export as JSON, classic or V2 resource), then:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
chant import checkout.json --output src # inside a project that lists grafana
|
|
28
|
+
chant import checkout.json --lexicon grafana --output src # anywhere else
|
|
29
|
+
chant build src --lexicon grafana -o dist/grafana/index.json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The importer also reads `GET /api/dashboards/uid/<uid>` responses, `dashboard.grafana.app` v1 and v2 resources, and datasource, dashboard and alerting provisioning files. Each dashboard lands in `src/<uid>/`: `dashboard.ts`, `panels.ts`, one `row-<title>.ts` per row, `variables.ts`, and `datasources.ts` with an `ExternalDatasource` per datasource named by uid. Replace an `ExternalDatasource` with a `Datasource` of the same uid to provision it from chant too.
|
|
33
|
+
|
|
34
|
+
Read every import warning. Anything the lexicon can't express is reported, never dropped. Common ones: a v2 dashboard's tabs become rows, an export made for sharing turns `${DS_*}` inputs into `DatasourceVariable`s, and two imported dashboards naming one datasource both declare it (GRAF104; delete one declaration and import it from the other file).
|
|
35
|
+
|
|
36
|
+
A dashboard inside a Kubernetes ConfigMap imports with the k8s lexicon: `chant import grafana-configmaps.yaml` gives a grafana `Dashboard` as the ConfigMap's value.
|
|
37
|
+
|
|
38
|
+
## Point environments at a Grafana
|
|
39
|
+
|
|
40
|
+
Observe, export and apply read `grafana.profiles.<env>` in `chant.config.ts`. Credentials are named by environment variable, never written in the file:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import type { ChantConfig } from "@intentius/chant/config";
|
|
44
|
+
import "@intentius/chant-lexicon-grafana";
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
lexicons: ["grafana"],
|
|
48
|
+
ownership: { stack: "shop", env: "prod" },
|
|
49
|
+
grafana: {
|
|
50
|
+
profiles: {
|
|
51
|
+
staging: { url: "https://grafana.staging.example.com", token: { env: "GRAFANA_STAGING_TOKEN" } },
|
|
52
|
+
prod: { url: "https://grafana.example.com", token: { env: "GRAFANA_PROD_TOKEN" }, orgId: 2 },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
} satisfies ChantConfig;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
With no profile, `GRAFANA_URL` plus `GRAFANA_TOKEN` (or `GRAFANA_USER` and `GRAFANA_PASSWORD`) is used. Grafana Cloud also needs `namespace: "stacks-<id>"`. A Viewer service account can observe and export. Applying needs Editor, or a custom role with `grafanaActionsFor("Apply", "Prune")`.
|
|
59
|
+
|
|
60
|
+
## Find what changed in Grafana
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
chant lifecycle diff staging --live
|
|
64
|
+
chant lifecycle diff staging --live --json # the same report as data
|
|
65
|
+
chant lifecycle diff staging --live --update-baseline # accept what it reported
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Paths are in your source's terms: `panels[0].panels[1].title` is the second panel of the first row. A value you declared that differs is drift. A value you never declared, such as a panel added in the UI, is listed as unclaimed and never proposed as a change. What the build fills in (panel ids, auto grid positions, refIds) and what Grafana adds on read are not reported. A dashboard Grafana 13 stores as v2 is read at v2 and diffed after conversion, so a tab added in the UI shows as drift in the rows.
|
|
69
|
+
|
|
70
|
+
Ownership decides what counts as chant's. A dashboard loaded by one of the project's providers (named `chant` unless you declared another `DashboardProvider`), or carrying the `app.kubernetes.io/managed-by: chant` label the applier writes, is `owned`. Anything else is `foreign`. Datasources and dashboards on Grafana 11 are `unknown`, and `--owned` leaves them out.
|
|
71
|
+
|
|
72
|
+
A `DashboardProvider` can't be observed (Grafana serves no API for provisioning files) and is reported as not observed, not missing.
|
|
73
|
+
|
|
74
|
+
## Export a Grafana as TypeScript
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
chant import --from staging --lexicon grafana --output src
|
|
78
|
+
chant import --from staging --lexicon grafana --type Grafana::Dashboard --name checkout --output src
|
|
79
|
+
chant import --from staging --lexicon grafana --owned --output src
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
It writes every dashboard and datasource in the organisation, laid out like a file import. Datasource secrets come back as `"[REDACTED]"`, each with a warning. Replace them with `$__env{NAME}` or `$__file{path}`, which GRAF002 requires.
|
|
83
|
+
|
|
84
|
+
## Apply over the HTTP API
|
|
85
|
+
|
|
86
|
+
When the build's files can't be mounted into Grafana, or you want real folders with pinned uids, apply from an Op:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
// ops/grafana.op.ts, with "build:grafana": "chant build src --lexicon grafana -o dist/grafana.json" in package.json
|
|
90
|
+
import { Op, phase, build } from "@intentius/chant/op";
|
|
91
|
+
import { grafanaApply } from "@intentius/chant-lexicon-grafana";
|
|
92
|
+
|
|
93
|
+
export default Op({
|
|
94
|
+
name: "grafana-prod",
|
|
95
|
+
phases: [
|
|
96
|
+
phase("Build", [build(".", { script: "build:grafana" })]),
|
|
97
|
+
phase("Apply", [grafanaApply("dist/grafana.json", { environment: "prod", prune: true })]),
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Run it with `chant run grafana-prod`, or from an agent through the MCP `op-run`, `op-status` and `op-signal` tools. The applier creates folders parents first with their uids, writes library panels found in `__elements`, and sends each dashboard with the project's labels. A dashboard whose live content already matches is `unchanged` and not written; a panel title edited in the UI is put back. `prune` deletes only dashboards and folders labelled with this project's stack and env. It never touches UI-saved or file-provisioned dashboards, library panels, or anything on Grafana 11, and does nothing when no `ownership.stack` is set. Datasources still come from the provisioning file.
|
|
103
|
+
|
|
104
|
+
## A loop that keeps UI edits
|
|
105
|
+
|
|
106
|
+
1. `chant lifecycle diff prod --live` shows the edit.
|
|
107
|
+
2. Either change the source to match and rebuild, or `chant import --from prod --name <uid>` to pull the dashboard, then copy the changed panel over.
|
|
108
|
+
3. Apply, or let provisioning reload, and diff again. It should report nothing.
|
|
@@ -26,11 +26,11 @@ const tempo = new Datasource({ name: "Tempo", type: "tempo", url: "http://tempo:
|
|
|
26
26
|
export { prometheus, tempo };
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
The uid defaults to the name as a uid (`prometheus`, `tempo`). Secrets go in `secureJsonData` as `"$__env{NAME}"` or `"$__file{/path}"`, never literally (GRAF002). A declared `Datasource` inside `jsonData` is written as its uid, which is how a Tempo datasource links to Loki or Prometheus.
|
|
29
|
+
The uid defaults to the name as a uid (`prometheus`, `tempo`). Secrets go in `secureJsonData` as `"$__env{NAME}"` or `"$__file{/path}"`, never literally (GRAF002). `jsonData` and the `secureJsonData` keys are typed per plugin for every plugin with a query class. A declared `Datasource` inside `jsonData` is written as its uid, which is how a Tempo datasource links to Loki or Prometheus and a Prometheus exemplar to Tempo; a link field only takes a datasource of a type Grafana offers there.
|
|
30
30
|
|
|
31
31
|
## Queries
|
|
32
32
|
|
|
33
|
-
`PromQuery` (PromQL in `expr`), `TempoQuery` (TraceQL in `query`)
|
|
33
|
+
`PromQuery` (PromQL in `expr`), `TempoQuery` (TraceQL in `query`), `LokiQuery` (LogQL in `expr`), `ElasticsearchQuery`, `CloudWatchQuery`, `AzureMonitorQuery`, `CloudMonitoringQuery`, `BigQueryQuery`, `PyroscopeQuery`, and `PostgresQuery`, `MySQLQuery` and `MSSQLQuery` (SQL in `rawSql`). Fields are typed from Grafana's own query schemas, or by hand for SQL. `datasource` only accepts a datasource of the query's plugin type, so a PromQL query can't be pointed at Tempo.
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
36
|
const requestRate = new PromQuery({
|
|
@@ -81,14 +81,15 @@ Pass the `prometheus` exporter as `exporter` to `RedDashboard` when its `namespa
|
|
|
81
81
|
|
|
82
82
|
## Rules
|
|
83
83
|
|
|
84
|
-
- GRAF101: every panel, query and query variable names a declared datasource (`Datasource` or `ExternalDatasource`), and every datasource variable's plugin type has one. GRAF102: of the right type.
|
|
84
|
+
- GRAF101: every panel, query, and query, ad hoc and group by variable names a declared datasource (`Datasource` or `ExternalDatasource`), and every datasource variable's plugin type has one. GRAF102: of the right type.
|
|
85
85
|
- GRAF103: every `$name`/`${name}` in a query, title or repeat is a declared variable (`$__*` are Grafana's own).
|
|
86
86
|
- GRAF104: unique dashboard uids, datasource uids and names, panel ids, variable names and refIds.
|
|
87
87
|
- GRAF105: panels fit the 24-column grid and don't overlap.
|
|
88
88
|
- GRAF106: uids of 1-40 letters, digits, `-`, `_`; dashboards have titles.
|
|
89
89
|
- GRAF107: the dashboard matches Grafana's schema at the pinned version.
|
|
90
|
-
- GRAF108: every query and query variable sent to a Prometheus parses as PromQL (template variables and `$__` macros are substituted first).
|
|
90
|
+
- GRAF108: every query and query variable sent to a Prometheus parses as PromQL (template variables and `$__` macros are substituted first; an object-form variable query is checked on its `query`).
|
|
91
91
|
- GRAF109: the dashboard providers put each dashboard in its declared folder, and no two load the same files.
|
|
92
|
+
- GRAF110: a panel or row repeats over a query, custom or datasource variable with `multi` or `includeAll`, or a group by variable; anything else shows it once (warning).
|
|
92
93
|
- GRAF115 (warning): every panel unit is a Grafana unit id (`bytes`, `s`, `percent`, `reqps`, ...) or a custom unit (`suffix: cores`, `prefix:$`, `si:mF`, `count:reqs`, `currency:EUR`). Grafana shows anything else as literal text after the value.
|
|
93
94
|
- GRAF111-GRAF114: alert rules, contact points, policies and mute timings; see the chant-grafana-alerting skill.
|
|
94
95
|
|