@intentius/chant-lexicon-grafana 0.96.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 +50 -0
- package/dist/build.d.ts +116 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/catalog.d.ts +26 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/codegen/docs-cli.d.ts +3 -0
- package/dist/codegen/docs-cli.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts +8 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +3 -0
- package/dist/codegen/generate-cli.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +21 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/package.d.ts +7 -0
- package/dist/codegen/package.d.ts.map +1 -0
- package/dist/codegen/schema-types.d.ts +41 -0
- package/dist/codegen/schema-types.d.ts.map +1 -0
- package/dist/composites/agent-dashboard.d.ts +70 -0
- package/dist/composites/agent-dashboard.d.ts.map +1 -0
- package/dist/composites/catalog.d.ts +3 -0
- package/dist/composites/catalog.d.ts.map +1 -0
- package/dist/composites/index.d.ts +12 -0
- package/dist/composites/index.d.ts.map +1 -0
- package/dist/composites/red-dashboard.d.ts +58 -0
- package/dist/composites/red-dashboard.d.ts.map +1 -0
- package/dist/composites/shared.d.ts +68 -0
- package/dist/composites/shared.d.ts.map +1 -0
- package/dist/composites/slo-dashboard.d.ts +62 -0
- package/dist/composites/slo-dashboard.d.ts.map +1 -0
- package/dist/dashboard.d.ts +84 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/datasource.d.ts +67 -0
- package/dist/datasource.d.ts.map +1 -0
- package/dist/detect.d.ts +20 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +22 -0
- package/dist/lint/audit-catalog.d.ts +13 -0
- package/dist/lint/audit-catalog.d.ts.map +1 -0
- package/dist/lint/post-synth/graf101.d.ts +8 -0
- package/dist/lint/post-synth/graf101.d.ts.map +1 -0
- package/dist/lint/post-synth/graf102.d.ts +8 -0
- package/dist/lint/post-synth/graf102.d.ts.map +1 -0
- package/dist/lint/post-synth/graf103.d.ts +8 -0
- package/dist/lint/post-synth/graf103.d.ts.map +1 -0
- package/dist/lint/post-synth/graf104.d.ts +8 -0
- package/dist/lint/post-synth/graf104.d.ts.map +1 -0
- package/dist/lint/post-synth/graf105.d.ts +8 -0
- package/dist/lint/post-synth/graf105.d.ts.map +1 -0
- package/dist/lint/post-synth/graf106.d.ts +8 -0
- package/dist/lint/post-synth/graf106.d.ts.map +1 -0
- package/dist/lint/post-synth/graf107.d.ts +8 -0
- package/dist/lint/post-synth/graf107.d.ts.map +1 -0
- package/dist/lint/post-synth/grafana-helpers.d.ts +16 -0
- package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts +3 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -0
- package/dist/lint/rules/grafana-ast.d.ts +21 -0
- package/dist/lint/rules/grafana-ast.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +6 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/literal-secret.d.ts +12 -0
- package/dist/lint/rules/literal-secret.d.ts.map +1 -0
- package/dist/lint/rules/uid-syntax.d.ts +12 -0
- package/dist/lint/rules/uid-syntax.d.ts.map +1 -0
- package/dist/lsp/completions.d.ts +4 -0
- package/dist/lsp/completions.d.ts.map +1 -0
- package/dist/lsp/hover.d.ts +4 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/manifest.json +8 -0
- package/dist/meta.json +107 -0
- package/dist/okf/index.md +39 -0
- package/dist/okf/rules/GRAF001.md +16 -0
- package/dist/okf/rules/GRAF002.md +15 -0
- package/dist/okf/rules/GRAF101.md +15 -0
- package/dist/okf/rules/GRAF102.md +15 -0
- package/dist/okf/rules/GRAF103.md +11 -0
- package/dist/okf/rules/GRAF104.md +15 -0
- package/dist/okf/rules/GRAF105.md +11 -0
- package/dist/okf/rules/GRAF106.md +11 -0
- package/dist/okf/rules/GRAF107.md +11 -0
- package/dist/okf/types/ConstantVariable.md +9 -0
- package/dist/okf/types/CustomVariable.md +9 -0
- package/dist/okf/types/Dashboard.md +14 -0
- package/dist/okf/types/DashboardProvider.md +9 -0
- package/dist/okf/types/Datasource.md +16 -0
- package/dist/okf/types/DatasourceVariable.md +9 -0
- package/dist/okf/types/GaugePanel.md +9 -0
- package/dist/okf/types/HeatmapPanel.md +9 -0
- package/dist/okf/types/IntervalVariable.md +9 -0
- package/dist/okf/types/LogsPanel.md +9 -0
- package/dist/okf/types/LokiQuery.md +9 -0
- package/dist/okf/types/PromQuery.md +9 -0
- package/dist/okf/types/QueryVariable.md +9 -0
- package/dist/okf/types/Row.md +9 -0
- package/dist/okf/types/StatPanel.md +9 -0
- package/dist/okf/types/TablePanel.md +9 -0
- package/dist/okf/types/TempoQuery.md +9 -0
- package/dist/okf/types/TextPanel.md +9 -0
- package/dist/okf/types/TextboxVariable.md +9 -0
- package/dist/okf/types/TimeSeriesPanel.md +9 -0
- package/dist/okf/types/TracesPanel.md +9 -0
- package/dist/package-cli.d.ts +3 -0
- package/dist/package-cli.d.ts.map +1 -0
- package/dist/panels.d.ts +138 -0
- package/dist/panels.d.ts.map +1 -0
- package/dist/pin.d.ts +32 -0
- package/dist/pin.d.ts.map +1 -0
- package/dist/plugin.d.ts +12 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/query.d.ts +81 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/rules/graf101.ts +17 -0
- package/dist/rules/graf102.ts +17 -0
- package/dist/rules/graf103.ts +17 -0
- package/dist/rules/graf104.ts +17 -0
- package/dist/rules/graf105.ts +17 -0
- package/dist/rules/graf106.ts +17 -0
- package/dist/rules/graf107.ts +17 -0
- package/dist/rules/grafana-ast.ts +70 -0
- package/dist/rules/grafana-helpers.ts +68 -0
- package/dist/rules/literal-secret.ts +48 -0
- package/dist/rules/uid-syntax.ts +56 -0
- package/dist/schema/dashboard.gen.d.ts +1231 -0
- package/dist/schema/dashboard.gen.d.ts.map +1 -0
- package/dist/schema/gauge.gen.d.ts +57 -0
- package/dist/schema/gauge.gen.d.ts.map +1 -0
- package/dist/schema/heatmap.gen.d.ts +295 -0
- package/dist/schema/heatmap.gen.d.ts.map +1 -0
- package/dist/schema/index.d.ts +18 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/logs.gen.d.ts +29 -0
- package/dist/schema/logs.gen.d.ts.map +1 -0
- package/dist/schema/loki.gen.d.ts +69 -0
- package/dist/schema/loki.gen.d.ts.map +1 -0
- package/dist/schema/prometheus.gen.d.ts +169 -0
- package/dist/schema/prometheus.gen.d.ts.map +1 -0
- package/dist/schema/stat.gen.d.ts +75 -0
- package/dist/schema/stat.gen.d.ts.map +1 -0
- package/dist/schema/table.gen.d.ts +295 -0
- package/dist/schema/table.gen.d.ts.map +1 -0
- package/dist/schema/tempo.gen.d.ts +136 -0
- package/dist/schema/tempo.gen.d.ts.map +1 -0
- package/dist/schema/text.gen.d.ts +16 -0
- package/dist/schema/text.gen.d.ts.map +1 -0
- package/dist/schema/timeseries.gen.d.ts +179 -0
- package/dist/schema/timeseries.gen.d.ts.map +1 -0
- package/dist/schema-validate.d.ts +20 -0
- package/dist/schema-validate.d.ts.map +1 -0
- package/dist/serializer.d.ts +22 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/skill-defs.d.ts +3 -0
- package/dist/skill-defs.d.ts.map +1 -0
- package/dist/skills/chant-grafana-provisioning.md +42 -0
- package/dist/skills/chant-grafana.md +93 -0
- package/dist/spec/fetch-cli.d.ts +3 -0
- package/dist/spec/fetch-cli.d.ts.map +1 -0
- package/dist/spec/schemas.d.ts +25 -0
- package/dist/spec/schemas.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/util.d.ts +17 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/validate-cli.d.ts +3 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate-output.d.ts +42 -0
- package/dist/validate-output.d.ts.map +1 -0
- package/dist/validate.d.ts +12 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/variables.d.ts +100 -0
- package/dist/variables.d.ts.map +1 -0
- package/package.json +79 -0
- package/src/build.test.ts +210 -0
- package/src/build.ts +573 -0
- package/src/catalog.ts +116 -0
- package/src/codegen/docs-cli.ts +4 -0
- package/src/codegen/docs.ts +97 -0
- package/src/codegen/generate-cli.ts +8 -0
- package/src/codegen/generate.ts +83 -0
- package/src/codegen/package.ts +41 -0
- package/src/codegen/schema-types.ts +173 -0
- package/src/composites/agent-dashboard.ts +235 -0
- package/src/composites/catalog.test.ts +37 -0
- package/src/composites/catalog.ts +223 -0
- package/src/composites/composites.test.ts +314 -0
- package/src/composites/index.ts +12 -0
- package/src/composites/red-dashboard.ts +159 -0
- package/src/composites/shared.ts +94 -0
- package/src/composites/slo-dashboard.ts +177 -0
- package/src/dashboard.ts +123 -0
- package/src/datasource.ts +93 -0
- package/src/detect.ts +30 -0
- package/src/generated/lexicon-grafana.json +107 -0
- package/src/import.e2e.test.ts +147 -0
- package/src/import.test.ts +45 -0
- package/src/index.ts +178 -0
- package/src/lint/audit-catalog.ts +87 -0
- package/src/lint/post-synth/graf101.ts +17 -0
- package/src/lint/post-synth/graf102.ts +17 -0
- package/src/lint/post-synth/graf103.ts +17 -0
- package/src/lint/post-synth/graf104.ts +17 -0
- package/src/lint/post-synth/graf105.ts +17 -0
- package/src/lint/post-synth/graf106.ts +17 -0
- package/src/lint/post-synth/graf107.ts +17 -0
- package/src/lint/post-synth/grafana-helpers.ts +68 -0
- package/src/lint/post-synth/index.ts +19 -0
- package/src/lint/post-synth/post-synth.test.ts +231 -0
- package/src/lint/rules/grafana-ast.ts +70 -0
- package/src/lint/rules/index.ts +9 -0
- package/src/lint/rules/literal-secret.ts +48 -0
- package/src/lint/rules/rules.test.ts +70 -0
- package/src/lint/rules/uid-syntax.ts +56 -0
- package/src/lsp/completions.test.ts +31 -0
- package/src/lsp/completions.ts +15 -0
- package/src/lsp/hover.test.ts +25 -0
- package/src/lsp/hover.ts +28 -0
- package/src/package-cli.ts +17 -0
- package/src/panels.ts +275 -0
- package/src/pin.ts +68 -0
- package/src/plugin.test.ts +50 -0
- package/src/plugin.ts +116 -0
- package/src/query.ts +160 -0
- package/src/schema/dashboard.gen.ts +1289 -0
- package/src/schema/gauge.gen.ts +64 -0
- package/src/schema/heatmap.gen.ts +321 -0
- package/src/schema/index.ts +17 -0
- package/src/schema/logs.gen.ts +34 -0
- package/src/schema/loki.gen.ts +77 -0
- package/src/schema/prometheus.gen.ts +181 -0
- package/src/schema/stat.gen.ts +86 -0
- package/src/schema/table.gen.ts +334 -0
- package/src/schema/tempo.gen.ts +146 -0
- package/src/schema/text.gen.ts +22 -0
- package/src/schema/timeseries.gen.ts +208 -0
- package/src/schema-validate.ts +143 -0
- package/src/schema.test.ts +76 -0
- package/src/serializer.test.ts +170 -0
- package/src/serializer.ts +37 -0
- package/src/skill-defs.ts +31 -0
- package/src/skills/chant-grafana-provisioning.md +42 -0
- package/src/skills/chant-grafana.md +93 -0
- package/src/spec/fetch-cli.ts +27 -0
- package/src/spec/schemas/dashboard.jsonschema.json +1901 -0
- package/src/spec/schemas/gauge.jsonschema.json +114 -0
- package/src/spec/schemas/heatmap.jsonschema.json +480 -0
- package/src/spec/schemas/logs.jsonschema.json +94 -0
- package/src/spec/schemas/loki.jsonschema.json +118 -0
- package/src/spec/schemas/prometheus.jsonschema.json +276 -0
- package/src/spec/schemas/stat.jsonschema.json +163 -0
- package/src/spec/schemas/table.jsonschema.json +751 -0
- package/src/spec/schemas/tempo.jsonschema.json +225 -0
- package/src/spec/schemas/text.jsonschema.json +72 -0
- package/src/spec/schemas/timeseries.jsonschema.json +471 -0
- package/src/spec/schemas.ts +56 -0
- package/src/util.ts +43 -0
- package/src/validate-cli.ts +7 -0
- package/src/validate-output.ts +380 -0
- package/src/validate.ts +108 -0
- package/src/variables.ts +161 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
okf_version: '0.2'
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Resource types
|
|
6
|
+
|
|
7
|
+
* [ConstantVariable](/types/ConstantVariable.md) - Grafana::Variable::constant
|
|
8
|
+
* [CustomVariable](/types/CustomVariable.md) - Grafana::Variable::custom
|
|
9
|
+
* [Dashboard](/types/Dashboard.md) - Grafana::Dashboard
|
|
10
|
+
* [DashboardProvider](/types/DashboardProvider.md) - Grafana::DashboardProvider
|
|
11
|
+
* [Datasource](/types/Datasource.md) - Grafana::Datasource
|
|
12
|
+
* [DatasourceVariable](/types/DatasourceVariable.md) - Grafana::Variable::datasource
|
|
13
|
+
* [GaugePanel](/types/GaugePanel.md) - Grafana::Panel::gauge
|
|
14
|
+
* [HeatmapPanel](/types/HeatmapPanel.md) - Grafana::Panel::heatmap
|
|
15
|
+
* [IntervalVariable](/types/IntervalVariable.md) - Grafana::Variable::interval
|
|
16
|
+
* [LogsPanel](/types/LogsPanel.md) - Grafana::Panel::logs
|
|
17
|
+
* [LokiQuery](/types/LokiQuery.md) - Grafana::Query::loki
|
|
18
|
+
* [PromQuery](/types/PromQuery.md) - Grafana::Query::prometheus
|
|
19
|
+
* [QueryVariable](/types/QueryVariable.md) - Grafana::Variable::query
|
|
20
|
+
* [Row](/types/Row.md) - Grafana::Row
|
|
21
|
+
* [StatPanel](/types/StatPanel.md) - Grafana::Panel::stat
|
|
22
|
+
* [TablePanel](/types/TablePanel.md) - Grafana::Panel::table
|
|
23
|
+
* [TempoQuery](/types/TempoQuery.md) - Grafana::Query::tempo
|
|
24
|
+
* [TextboxVariable](/types/TextboxVariable.md) - Grafana::Variable::textbox
|
|
25
|
+
* [TextPanel](/types/TextPanel.md) - Grafana::Panel::text
|
|
26
|
+
* [TimeSeriesPanel](/types/TimeSeriesPanel.md) - Grafana::Panel::timeseries
|
|
27
|
+
* [TracesPanel](/types/TracesPanel.md) - Grafana::Panel::traces
|
|
28
|
+
|
|
29
|
+
# Rules
|
|
30
|
+
|
|
31
|
+
* [GRAF001](/rules/GRAF001.md) - a uid Grafana rejects, or a variable name queries cannot reference.
|
|
32
|
+
* [GRAF002](/rules/GRAF002.md) - a datasource secret written as a literal.
|
|
33
|
+
* [GRAF101](/rules/GRAF101.md) - A panel, query or variable uses a datasource no Datasource in the build declares
|
|
34
|
+
* [GRAF102](/rules/GRAF102.md) - A query is sent to a datasource of another plugin type
|
|
35
|
+
* [GRAF103](/rules/GRAF103.md) - A query, title, datasource or repeat uses a variable the dashboard does not declare
|
|
36
|
+
* [GRAF104](/rules/GRAF104.md) - Two dashboards, datasources, panels, variables or queries share an id
|
|
37
|
+
* [GRAF105](/rules/GRAF105.md) - A panel does not fit the 24-column grid, or overlaps another panel
|
|
38
|
+
* [GRAF106](/rules/GRAF106.md) - A dashboard or datasource uid Grafana rejects, or a dashboard with no title
|
|
39
|
+
* [GRAF107](/rules/GRAF107.md) - A dashboard does not match the pinned Grafana schema
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: lint-rule
|
|
3
|
+
title: GRAF001
|
|
4
|
+
description: a uid Grafana rejects, or a variable name queries cannot reference.
|
|
5
|
+
id: GRAF001
|
|
6
|
+
severity: error
|
|
7
|
+
category: correctness
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
a uid Grafana rejects, or a variable name queries cannot reference.
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Dashboard](/types/Dashboard.md)
|
|
16
|
+
- [Datasource](/types/Datasource.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: lint-rule
|
|
3
|
+
title: GRAF002
|
|
4
|
+
description: a datasource secret written as a literal.
|
|
5
|
+
id: GRAF002
|
|
6
|
+
severity: error
|
|
7
|
+
category: security
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
a datasource secret written as a literal.
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Datasource](/types/Datasource.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: GRAF101
|
|
4
|
+
description: A panel, query or variable uses a datasource no Datasource in the build declares
|
|
5
|
+
id: GRAF101
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
A panel, query or variable uses a datasource no Datasource in the build declares
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Datasource](/types/Datasource.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: GRAF102
|
|
4
|
+
description: A query is sent to a datasource of another plugin type
|
|
5
|
+
id: GRAF102
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
A query is sent to a datasource of another plugin type
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Datasource](/types/Datasource.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: GRAF103
|
|
4
|
+
description: A query, title, datasource or repeat uses a variable the dashboard does not declare
|
|
5
|
+
id: GRAF103
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
A query, title, datasource or repeat uses a variable the dashboard does not declare
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: GRAF104
|
|
4
|
+
description: Two dashboards, datasources, panels, variables or queries share an id
|
|
5
|
+
id: GRAF104
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
Two dashboards, datasources, panels, variables or queries share an id
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Dashboard](/types/Dashboard.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: GRAF105
|
|
4
|
+
description: A panel does not fit the 24-column grid, or overlaps another panel
|
|
5
|
+
id: GRAF105
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
A panel does not fit the 24-column grid, or overlaps another panel
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: GRAF106
|
|
4
|
+
description: A dashboard or datasource uid Grafana rejects, or a dashboard with no title
|
|
5
|
+
id: GRAF106
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
A dashboard or datasource uid Grafana rejects, or a dashboard with no title
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: GRAF107
|
|
4
|
+
description: A dashboard does not match the pinned Grafana schema
|
|
5
|
+
id: GRAF107
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: grafana
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/grafana/rules/
|
|
10
|
+
---
|
|
11
|
+
A dashboard does not match the pinned Grafana schema
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: ConstantVariable
|
|
4
|
+
description: grafana resource type Grafana::Variable::constant
|
|
5
|
+
name: ConstantVariable
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Variable::constant
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Variable::constant`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: CustomVariable
|
|
4
|
+
description: grafana resource type Grafana::Variable::custom
|
|
5
|
+
name: CustomVariable
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Variable::custom
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Variable::custom`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: Dashboard
|
|
4
|
+
description: grafana resource type Grafana::Dashboard
|
|
5
|
+
name: Dashboard
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Dashboard
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Dashboard`, a resource type of the grafana lexicon.
|
|
10
|
+
|
|
11
|
+
## Governed by
|
|
12
|
+
|
|
13
|
+
- [GRAF001](/rules/GRAF001.md): a uid Grafana rejects, or a variable name queries cannot reference.
|
|
14
|
+
- [GRAF104](/rules/GRAF104.md): Two dashboards, datasources, panels, variables or queries share an id
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: DashboardProvider
|
|
4
|
+
description: grafana resource type Grafana::DashboardProvider
|
|
5
|
+
name: DashboardProvider
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::DashboardProvider
|
|
8
|
+
---
|
|
9
|
+
`Grafana::DashboardProvider`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: Datasource
|
|
4
|
+
description: grafana resource type Grafana::Datasource
|
|
5
|
+
name: Datasource
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Datasource
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Datasource`, a resource type of the grafana lexicon.
|
|
10
|
+
|
|
11
|
+
## Governed by
|
|
12
|
+
|
|
13
|
+
- [GRAF001](/rules/GRAF001.md): a uid Grafana rejects, or a variable name queries cannot reference.
|
|
14
|
+
- [GRAF002](/rules/GRAF002.md): a datasource secret written as a literal.
|
|
15
|
+
- [GRAF101](/rules/GRAF101.md): A panel, query or variable uses a datasource no Datasource in the build declares
|
|
16
|
+
- [GRAF102](/rules/GRAF102.md): A query is sent to a datasource of another plugin type
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: DatasourceVariable
|
|
4
|
+
description: grafana resource type Grafana::Variable::datasource
|
|
5
|
+
name: DatasourceVariable
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Variable::datasource
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Variable::datasource`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: HeatmapPanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::heatmap
|
|
5
|
+
name: HeatmapPanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::heatmap
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::heatmap`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: IntervalVariable
|
|
4
|
+
description: grafana resource type Grafana::Variable::interval
|
|
5
|
+
name: IntervalVariable
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Variable::interval
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Variable::interval`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: PromQuery
|
|
4
|
+
description: grafana resource type Grafana::Query::prometheus
|
|
5
|
+
name: PromQuery
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Query::prometheus
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Query::prometheus`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: QueryVariable
|
|
4
|
+
description: grafana resource type Grafana::Variable::query
|
|
5
|
+
name: QueryVariable
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Variable::query
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Variable::query`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: TextboxVariable
|
|
4
|
+
description: grafana resource type Grafana::Variable::textbox
|
|
5
|
+
name: TextboxVariable
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Variable::textbox
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Variable::textbox`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: TimeSeriesPanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::timeseries
|
|
5
|
+
name: TimeSeriesPanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::timeseries
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::timeseries`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-cli.d.ts","sourceRoot":"","sources":["../src/package-cli.ts"],"names":[],"mappings":""}
|
package/dist/panels.d.ts
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panels and rows.
|
|
3
|
+
*
|
|
4
|
+
* Each built-in panel class is defined through `definePanel`, with its
|
|
5
|
+
* `options` and `fieldConfig.defaults.custom` typed from that panel's
|
|
6
|
+
* schema at `GRAFANA_SCHEMA_PIN`. Every option is optional: Grafana fills
|
|
7
|
+
* in what a panel leaves out when it loads the dashboard. A panel plugin
|
|
8
|
+
* chant doesn't ship (a community visualization, an in-house plugin) comes
|
|
9
|
+
* in through `definePanel` too and is laid out, serialized and checked the
|
|
10
|
+
* same way.
|
|
11
|
+
*
|
|
12
|
+
* `gridPos` is optional. A panel without `x` and `y` is placed by the
|
|
13
|
+
* dashboard: left to right in declaration order, wrapping at Grafana's
|
|
14
|
+
* 24-column width, below the previous row of panels. A panel with both is
|
|
15
|
+
* placed exactly there, and GRAF105 reports overlaps.
|
|
16
|
+
*/
|
|
17
|
+
import type { Declarable } from "@intentius/chant/declarable";
|
|
18
|
+
import type { DeepPartial } from "./util.js";
|
|
19
|
+
import type { DatasourceInput, QueryEntity } from "./query.js";
|
|
20
|
+
import type { VariableEntity } from "./variables.js";
|
|
21
|
+
import type { SchemaName } from "./pin.js";
|
|
22
|
+
import type { DashboardLink, DataTransformerConfig, FieldConfig, FieldConfigSource, GridPos } from "./schema/dashboard.gen.js";
|
|
23
|
+
import type * as timeseries from "./schema/timeseries.gen.js";
|
|
24
|
+
import type * as stat from "./schema/stat.gen.js";
|
|
25
|
+
import type * as gauge from "./schema/gauge.gen.js";
|
|
26
|
+
import type * as table from "./schema/table.gen.js";
|
|
27
|
+
import type * as logs from "./schema/logs.gen.js";
|
|
28
|
+
import type * as heatmap from "./schema/heatmap.gen.js";
|
|
29
|
+
import type * as text from "./schema/text.gen.js";
|
|
30
|
+
/** `fieldConfig` with `defaults.custom` typed for the panel. */
|
|
31
|
+
export interface PanelFieldConfig<C> {
|
|
32
|
+
defaults?: DeepPartial<Omit<FieldConfig, "custom">> & {
|
|
33
|
+
custom?: DeepPartial<C>;
|
|
34
|
+
};
|
|
35
|
+
overrides?: FieldConfigSource["overrides"];
|
|
36
|
+
}
|
|
37
|
+
/** A panel link: Grafana's `DashboardLink` fields, all but `title` optional. */
|
|
38
|
+
export type PanelLink = Partial<DashboardLink> & {
|
|
39
|
+
title: string;
|
|
40
|
+
url?: string;
|
|
41
|
+
};
|
|
42
|
+
export interface PanelProps<O = Record<string, unknown>, C = Record<string, unknown>> {
|
|
43
|
+
title?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
/** Position and size in the 24-column grid. Leave out `x`/`y` to let the dashboard place it. */
|
|
46
|
+
gridPos?: Partial<GridPos>;
|
|
47
|
+
/** The datasource for every query that doesn't name its own. */
|
|
48
|
+
datasource?: DatasourceInput<any>;
|
|
49
|
+
/** The panel's queries. `refId`s default to A, B, C… in order. */
|
|
50
|
+
targets?: QueryEntity<any, any>[];
|
|
51
|
+
/** The panel plugin's own options, typed from its schema. */
|
|
52
|
+
options?: DeepPartial<O>;
|
|
53
|
+
fieldConfig?: PanelFieldConfig<C>;
|
|
54
|
+
transformations?: DataTransformerConfig[];
|
|
55
|
+
links?: PanelLink[];
|
|
56
|
+
/** Repeat the panel once per value of this variable. */
|
|
57
|
+
repeat?: VariableEntity | string;
|
|
58
|
+
repeatDirection?: "h" | "v";
|
|
59
|
+
maxPerRow?: number;
|
|
60
|
+
maxDataPoints?: number;
|
|
61
|
+
interval?: string;
|
|
62
|
+
timeFrom?: string;
|
|
63
|
+
timeShift?: string;
|
|
64
|
+
hideTimeOverride?: boolean;
|
|
65
|
+
transparent?: boolean;
|
|
66
|
+
pluginVersion?: string;
|
|
67
|
+
/** Panel id within the dashboard. Defaults to position order, 1, 2, 3… */
|
|
68
|
+
id?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface PanelDefinition<T extends string = string> {
|
|
71
|
+
/** The panel plugin id Grafana stores in `type`. */
|
|
72
|
+
type: T;
|
|
73
|
+
className: string;
|
|
74
|
+
description?: string;
|
|
75
|
+
/** Size used when `gridPos` leaves `w` or `h` out. */
|
|
76
|
+
defaultSize: {
|
|
77
|
+
w: number;
|
|
78
|
+
h: number;
|
|
79
|
+
};
|
|
80
|
+
/** The vendored schema its options follow, when there is one (GRAF107 validates against it). */
|
|
81
|
+
schema?: SchemaName;
|
|
82
|
+
/** True only for the panels this package ships. */
|
|
83
|
+
builtin: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface PanelEntity<O = Record<string, unknown>, C = Record<string, unknown>> extends Declarable {
|
|
86
|
+
readonly props: PanelProps<O, C>;
|
|
87
|
+
readonly panelDefinition: PanelDefinition;
|
|
88
|
+
}
|
|
89
|
+
export interface PanelClass<T extends string = string, O = Record<string, unknown>, C = Record<string, unknown>> {
|
|
90
|
+
new (props?: PanelProps<O, C>): PanelEntity<O, C>;
|
|
91
|
+
readonly definition: PanelDefinition<T>;
|
|
92
|
+
}
|
|
93
|
+
export declare const PANEL_TYPE_PREFIX = "Grafana::Panel::";
|
|
94
|
+
export declare const ROW_TYPE = "Grafana::Row";
|
|
95
|
+
/** Every registered panel definition, built-ins first. */
|
|
96
|
+
export declare function registeredPanels(): PanelDefinition[];
|
|
97
|
+
export declare function panelDefinitionFor(type: string): PanelDefinition | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Define a panel class for a panel plugin chant doesn't ship.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* interface PieOptions { pieType?: "pie" | "donut"; legend?: { showLegend?: boolean } }
|
|
104
|
+
*
|
|
105
|
+
* export const PieChartPanel = definePanel<PieOptions>()({
|
|
106
|
+
* type: "piechart",
|
|
107
|
+
* className: "PieChartPanel",
|
|
108
|
+
* defaultSize: { w: 8, h: 8 },
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export declare function definePanel<O = Record<string, unknown>, C = Record<string, unknown>>(): <T extends string>(def: Omit<PanelDefinition<T>, "builtin">) => PanelClass<T, O, C>;
|
|
113
|
+
export declare function isPanelEntity(value: unknown): value is PanelEntity;
|
|
114
|
+
export declare const TimeSeriesPanel: PanelClass<"timeseries", timeseries.Options, timeseries.GraphFieldConfig>;
|
|
115
|
+
export declare const StatPanel: PanelClass<"stat", stat.Options, Record<string, unknown>>;
|
|
116
|
+
export declare const GaugePanel: PanelClass<"gauge", gauge.Options, Record<string, unknown>>;
|
|
117
|
+
export declare const TablePanel: PanelClass<"table", table.Options, table.TableFieldOptions>;
|
|
118
|
+
export declare const LogsPanel: PanelClass<"logs", logs.Options, Record<string, unknown>>;
|
|
119
|
+
export declare const TracesPanel: PanelClass<"traces", Record<string, unknown>, Record<string, unknown>>;
|
|
120
|
+
export declare const HeatmapPanel: PanelClass<"heatmap", heatmap.Options, heatmap.FieldConfig>;
|
|
121
|
+
export declare const TextPanel: PanelClass<"text", text.Options, Record<string, unknown>>;
|
|
122
|
+
export interface RowProps {
|
|
123
|
+
title: string;
|
|
124
|
+
/** Collapsed rows keep their panels inside the row until opened. */
|
|
125
|
+
collapsed?: boolean;
|
|
126
|
+
panels?: PanelEntity<any, any>[];
|
|
127
|
+
/** Repeat the row once per value of this variable. */
|
|
128
|
+
repeat?: VariableEntity | string;
|
|
129
|
+
datasource?: DatasourceInput<any>;
|
|
130
|
+
id?: number;
|
|
131
|
+
}
|
|
132
|
+
export interface RowEntity extends Declarable {
|
|
133
|
+
readonly props: RowProps;
|
|
134
|
+
}
|
|
135
|
+
/** A full-width row header; the panels listed in it are placed below it. */
|
|
136
|
+
export declare const Row: new (props: RowProps) => RowEntity;
|
|
137
|
+
export declare function isRowEntity(value: unknown):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AG,KAAK,IAAI,SAAS,CAE9D"}
|
package/dist/pin.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Grafana schemas this lexicon's types are generated from.
|
|
3
|
+
*
|
|
4
|
+
* Grafana defines dashboards, panel options and datasource queries as CUE
|
|
5
|
+
* kinds. `grafana/grafana-foundation-sdk` runs them through cog and
|
|
6
|
+
* publishes, beside its builder libraries, one JSON Schema per kind under
|
|
7
|
+
* `jsonschema/`. This lexicon vendors the files it uses into `src/spec/schemas/`
|
|
8
|
+
* (exact bytes, at the commit below) and generates `src/schema/*.gen.ts`
|
|
9
|
+
* from them. Nothing is fetched at build or test time.
|
|
10
|
+
*
|
|
11
|
+
* Bumping the pin: change `ref` and `commit`, run `just fetch-schemas`
|
|
12
|
+
* (downloads and prints the new digests), paste the digests here, run
|
|
13
|
+
* `npm run generate`, and review the diff of `src/schema/`.
|
|
14
|
+
*/
|
|
15
|
+
export interface GrafanaSchemaPin {
|
|
16
|
+
/** Where the schema files come from. */
|
|
17
|
+
source: string;
|
|
18
|
+
/** The tag the commit is published under. */
|
|
19
|
+
ref: string;
|
|
20
|
+
/** The exact commit the vendored files were taken from. */
|
|
21
|
+
commit: string;
|
|
22
|
+
/** The Grafana kind registry version cog generated the schemas from. */
|
|
23
|
+
kindRegistry: string;
|
|
24
|
+
/** sha256 of each vendored file, keyed by schema name (`src/spec/schemas/<name>.jsonschema.json`). */
|
|
25
|
+
files: Readonly<Record<SchemaName, string>>;
|
|
26
|
+
}
|
|
27
|
+
export declare const SCHEMA_NAMES: readonly ["dashboard", "timeseries", "stat", "gauge", "table", "logs", "heatmap", "text", "prometheus", "tempo", "loki"];
|
|
28
|
+
export type SchemaName = (typeof SCHEMA_NAMES)[number];
|
|
29
|
+
export declare const GRAFANA_SCHEMA_PIN: GrafanaSchemaPin;
|
|
30
|
+
/** The raw URL of one schema file at the pinned commit. */
|
|
31
|
+
export declare function schemaUrl(name: SchemaName, pin?: GrafanaSchemaPin): string;
|
|
32
|
+
//# sourceMappingURL=pin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pin.d.ts","sourceRoot":"","sources":["../src/pin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7C;AAED,eAAO,MAAM,YAAY,0HAYf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,kBAAkB,EAAE,gBAkB/B,CAAC;AAEH,2DAA2D;AAC3D,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,GAAE,gBAAqC,GAAG,MAAM,CAE9F"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LexiconPlugin } from "@intentius/chant/lexicon";
|
|
2
|
+
/**
|
|
3
|
+
* Grafana lexicon plugin.
|
|
4
|
+
*
|
|
5
|
+
* Dashboards, panels, typed Prometheus, Tempo and Loki queries, variables
|
|
6
|
+
* and datasources, serialized to dashboard JSON and Grafana's provisioning
|
|
7
|
+
* files. Panel options and query models are generated from Grafana's own
|
|
8
|
+
* schemas at `GRAFANA_SCHEMA_PIN`; `definePanel` and `defineQuery` add
|
|
9
|
+
* plugins chant doesn't ship.
|
|
10
|
+
*/
|
|
11
|
+
export declare const grafanaPlugin: LexiconPlugin;
|
|
12
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AA0B9D;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,aAgF3B,CAAC"}
|