@intentius/chant-lexicon-grafana 0.98.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 +24 -8
- package/dist/actions/grafana.d.ts +24 -0
- package/dist/actions/grafana.d.ts.map +1 -0
- package/dist/actions/index.d.ts +2 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/alerting-build.d.ts +128 -0
- package/dist/alerting-build.d.ts.map +1 -0
- package/dist/alerting.d.ts +273 -0
- package/dist/alerting.d.ts.map +1 -0
- package/dist/annotations.d.ts +61 -0
- package/dist/annotations.d.ts.map +1 -0
- package/dist/api/apply.d.ts +160 -0
- package/dist/api/apply.d.ts.map +1 -0
- package/dist/api/bind.d.ts +32 -0
- package/dist/api/bind.d.ts.map +1 -0
- package/dist/api/client.d.ts +76 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/converge.d.ts +33 -0
- package/dist/api/converge.d.ts.map +1 -0
- package/dist/api/dashboards.d.ts +102 -0
- package/dist/api/dashboards.d.ts.map +1 -0
- package/dist/api/datasources.d.ts +26 -0
- package/dist/api/datasources.d.ts.map +1 -0
- package/dist/api/fake-grafana-writes.d.ts +41 -0
- package/dist/api/fake-grafana-writes.d.ts.map +1 -0
- package/dist/api/fake-grafana.d.ts +63 -0
- package/dist/api/fake-grafana.d.ts.map +1 -0
- package/dist/api/folders.d.ts +146 -0
- package/dist/api/folders.d.ts.map +1 -0
- package/dist/api/library-panels.d.ts +52 -0
- package/dist/api/library-panels.d.ts.map +1 -0
- package/dist/build.d.ts +55 -6
- 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/codegen/schema-types.d.ts +3 -3
- package/dist/codegen/schema-types.d.ts.map +1 -1
- package/dist/composites/agent-dashboard.d.ts.map +1 -1
- package/dist/composites/catalog.d.ts.map +1 -1
- package/dist/composites/index.d.ts +4 -2
- package/dist/composites/index.d.ts.map +1 -1
- package/dist/composites/red-dashboard.d.ts +21 -2
- package/dist/composites/red-dashboard.d.ts.map +1 -1
- package/dist/composites/shared.d.ts +11 -3
- package/dist/composites/shared.d.ts.map +1 -1
- package/dist/composites/slo-alert-rules.d.ts +92 -0
- package/dist/composites/slo-alert-rules.d.ts.map +1 -0
- package/dist/config.d.ts +111 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/contact-point-secrets.d.ts +17 -0
- package/dist/contact-point-secrets.d.ts.map +1 -0
- package/dist/dashboard.d.ts +51 -9
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/datasource-refs.d.ts +99 -0
- package/dist/datasource-refs.d.ts.map +1 -0
- package/dist/datasource-settings.d.ts +834 -0
- package/dist/datasource-settings.d.ts.map +1 -0
- package/dist/datasource.d.ts +82 -11
- package/dist/datasource.d.ts.map +1 -1
- package/dist/deep-observe-hooks.d.ts +64 -0
- package/dist/deep-observe-hooks.d.ts.map +1 -0
- package/dist/deep-observe.d.ts +47 -0
- package/dist/deep-observe.d.ts.map +1 -0
- package/dist/describe-resources.d.ts +50 -0
- package/dist/describe-resources.d.ts.map +1 -0
- package/dist/detect.d.ts +32 -3
- package/dist/detect.d.ts.map +1 -1
- package/dist/export-resources.d.ts +38 -0
- package/dist/export-resources.d.ts.map +1 -0
- package/dist/folder.d.ts +68 -0
- package/dist/folder.d.ts.map +1 -0
- package/dist/import/alerting.d.ts +40 -0
- package/dist/import/alerting.d.ts.map +1 -0
- package/dist/import/edits.d.ts +47 -0
- package/dist/import/edits.d.ts.map +1 -0
- package/dist/import/embedded.d.ts +14 -0
- package/dist/import/embedded.d.ts.map +1 -0
- package/dist/import/generator.d.ts +60 -0
- package/dist/import/generator.d.ts.map +1 -0
- package/dist/import/live-export.d.ts +108 -0
- package/dist/import/live-export.d.ts.map +1 -0
- package/dist/import/mappings.d.ts +89 -0
- package/dist/import/mappings.d.ts.map +1 -0
- package/dist/import/model.d.ts +105 -0
- package/dist/import/model.d.ts.map +1 -0
- package/dist/import/normalize-alerting.d.ts +26 -0
- package/dist/import/normalize-alerting.d.ts.map +1 -0
- package/dist/import/normalize.d.ts +74 -0
- package/dist/import/normalize.d.ts.map +1 -0
- package/dist/import/parser.d.ts +125 -0
- package/dist/import/parser.d.ts.map +1 -0
- package/dist/import/report.d.ts +26 -0
- package/dist/import/report.d.ts.map +1 -0
- package/dist/import/testdata/fixtures.d.ts +41 -0
- package/dist/import/testdata/fixtures.d.ts.map +1 -0
- package/dist/import/v2.d.ts +73 -0
- package/dist/import/v2.d.ts.map +1 -0
- package/dist/index.d.ts +31 -12
- 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 +22 -12
- package/dist/k8s.d.ts +107 -0
- package/dist/k8s.d.ts.map +1 -0
- package/dist/lint/audit-catalog.d.ts +2 -1
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/post-synth/graf101.d.ts +2 -2
- package/dist/lint/post-synth/graf102.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/graf107.d.ts +1 -1
- package/dist/lint/post-synth/graf108.d.ts +8 -0
- package/dist/lint/post-synth/graf108.d.ts.map +1 -0
- package/dist/lint/post-synth/graf109.d.ts +8 -0
- package/dist/lint/post-synth/graf109.d.ts.map +1 -0
- 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/graf111.d.ts +8 -0
- package/dist/lint/post-synth/graf111.d.ts.map +1 -0
- package/dist/lint/post-synth/graf112.d.ts +8 -0
- package/dist/lint/post-synth/graf112.d.ts.map +1 -0
- package/dist/lint/post-synth/graf113.d.ts +8 -0
- package/dist/lint/post-synth/graf113.d.ts.map +1 -0
- package/dist/lint/post-synth/graf114.d.ts +8 -0
- package/dist/lint/post-synth/graf114.d.ts.map +1 -0
- package/dist/lint/post-synth/graf115.d.ts +8 -0
- package/dist/lint/post-synth/graf115.d.ts.map +1 -0
- package/dist/lint/post-synth/grafana-helpers.d.ts +7 -5
- 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/lint/rules/literal-secret.d.ts +7 -3
- package/dist/lint/rules/literal-secret.d.ts.map +1 -1
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/members.d.ts +27 -0
- package/dist/members.d.ts.map +1 -0
- package/dist/meta.json +205 -0
- package/dist/okf/index.md +53 -4
- package/dist/okf/rules/GRAF002.md +3 -2
- package/dist/okf/rules/GRAF101.md +3 -2
- package/dist/okf/rules/GRAF102.md +1 -0
- package/dist/okf/rules/GRAF104.md +2 -2
- package/dist/okf/rules/GRAF106.md +2 -2
- package/dist/okf/rules/GRAF108.md +11 -0
- package/dist/okf/rules/GRAF109.md +15 -0
- package/dist/okf/rules/GRAF110.md +11 -0
- package/dist/okf/rules/GRAF111.md +11 -0
- package/dist/okf/rules/GRAF112.md +16 -0
- package/dist/okf/rules/GRAF113.md +16 -0
- package/dist/okf/rules/GRAF114.md +11 -0
- package/dist/okf/rules/GRAF115.md +11 -0
- package/dist/okf/types/AdhocVariable.md +9 -0
- package/dist/okf/types/AlertListPanel.md +9 -0
- package/dist/okf/types/AlertQuery.md +9 -0
- package/dist/okf/types/AlertRule.md +9 -0
- package/dist/okf/types/AlertRuleGroup.md +9 -0
- package/dist/okf/types/AzureMonitorQuery.md +9 -0
- package/dist/okf/types/BarChartPanel.md +9 -0
- package/dist/okf/types/BarGaugePanel.md +9 -0
- package/dist/okf/types/BigQueryQuery.md +9 -0
- package/dist/okf/types/CanvasPanel.md +9 -0
- package/dist/okf/types/ClassicConditionsExpression.md +9 -0
- package/dist/okf/types/CloudMonitoringQuery.md +9 -0
- package/dist/okf/types/CloudWatchQuery.md +9 -0
- package/dist/okf/types/ContactPoint.md +14 -0
- package/dist/okf/types/Dashboard.md +2 -1
- package/dist/okf/types/Datasource.md +3 -2
- package/dist/okf/types/DatasourceProvisioning.md +9 -0
- package/dist/okf/types/ElasticsearchQuery.md +9 -0
- package/dist/okf/types/ExternalDatasource.md +15 -0
- package/dist/okf/types/FlameGraphPanel.md +9 -0
- package/dist/okf/types/Folder.md +9 -0
- package/dist/okf/types/GeomapPanel.md +9 -0
- package/dist/okf/types/GroupByVariable.md +9 -0
- package/dist/okf/types/HistogramPanel.md +9 -0
- package/dist/okf/types/MSSQLQuery.md +9 -0
- package/dist/okf/types/MathExpression.md +9 -0
- package/dist/okf/types/MuteTiming.md +13 -0
- package/dist/okf/types/MySQLQuery.md +9 -0
- package/dist/okf/types/NodeGraphPanel.md +9 -0
- package/dist/okf/types/NotificationPolicy.md +9 -0
- package/dist/okf/types/NotificationTemplate.md +9 -0
- package/dist/okf/types/PieChartPanel.md +9 -0
- package/dist/okf/types/PostgresQuery.md +9 -0
- package/dist/okf/types/PyroscopeQuery.md +9 -0
- package/dist/okf/types/ReduceExpression.md +9 -0
- package/dist/okf/types/ResampleExpression.md +9 -0
- package/dist/okf/types/SqlExpression.md +9 -0
- package/dist/okf/types/StateTimelinePanel.md +9 -0
- package/dist/okf/types/StatusHistoryPanel.md +9 -0
- package/dist/okf/types/SwitchVariable.md +9 -0
- package/dist/okf/types/ThresholdExpression.md +9 -0
- package/dist/okf/types/TrendPanel.md +9 -0
- package/dist/okf/types/XYChartPanel.md +9 -0
- package/dist/op/activities/grafana-apply.d.ts +86 -0
- package/dist/op/activities/grafana-apply.d.ts.map +1 -0
- package/dist/op/activities/index.d.ts +9 -0
- package/dist/op/activities/index.d.ts.map +1 -0
- package/dist/op/builders.d.ts +24 -0
- package/dist/op/builders.d.ts.map +1 -0
- package/dist/ownership.d.ts +78 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/panel-options.d.ts +65 -0
- package/dist/panel-options.d.ts.map +1 -0
- package/dist/panels.d.ts +46 -9
- package/dist/panels.d.ts.map +1 -1
- package/dist/pin.d.ts +29 -7
- package/dist/pin.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/promql-check.d.ts +51 -0
- package/dist/promql-check.d.ts.map +1 -0
- package/dist/query-models.d.ts +95 -0
- package/dist/query-models.d.ts.map +1 -0
- package/dist/query.d.ts +116 -18
- package/dist/query.d.ts.map +1 -1
- package/dist/rules/graf101.ts +3 -3
- package/dist/rules/graf102.ts +1 -1
- package/dist/rules/graf104.ts +3 -3
- package/dist/rules/graf106.ts +3 -3
- package/dist/rules/graf107.ts +1 -1
- package/dist/rules/graf108.ts +17 -0
- package/dist/rules/graf109.ts +17 -0
- package/dist/rules/graf110.ts +17 -0
- package/dist/rules/graf111.ts +17 -0
- package/dist/rules/graf112.ts +17 -0
- package/dist/rules/graf113.ts +17 -0
- package/dist/rules/graf114.ts +17 -0
- package/dist/rules/graf115.ts +17 -0
- package/dist/rules/grafana-helpers.ts +27 -10
- package/dist/rules/literal-secret.ts +60 -6
- package/dist/schema/azuremonitor.gen.d.ts +354 -0
- package/dist/schema/azuremonitor.gen.d.ts.map +1 -0
- package/dist/schema/barchart.gen.d.ts +198 -0
- package/dist/schema/barchart.gen.d.ts.map +1 -0
- package/dist/schema/bargauge.gen.d.ts +97 -0
- package/dist/schema/bargauge.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/canvas.gen.d.ts +152 -0
- package/dist/schema/canvas.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/dashboard.gen.d.ts +196 -21
- package/dist/schema/dashboard.gen.d.ts.map +1 -1
- package/dist/schema/elasticsearch.gen.d.ts +444 -0
- package/dist/schema/elasticsearch.gen.d.ts.map +1 -0
- package/dist/schema/expr.gen.d.ts +606 -0
- package/dist/schema/expr.gen.d.ts.map +1 -0
- package/dist/schema/gauge.gen.d.ts.map +1 -1
- package/dist/schema/geomap.gen.d.ts +100 -0
- package/dist/schema/geomap.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/heatmap.gen.d.ts.map +1 -1
- package/dist/schema/histogram.gen.d.ts +132 -0
- package/dist/schema/histogram.gen.d.ts.map +1 -0
- package/dist/schema/index.d.ts +18 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/logs.gen.d.ts +1 -0
- package/dist/schema/logs.gen.d.ts.map +1 -1
- package/dist/schema/loki.gen.d.ts.map +1 -1
- package/dist/schema/nodegraph.gen.d.ts +49 -0
- package/dist/schema/nodegraph.gen.d.ts.map +1 -0
- package/dist/schema/piechart.gen.d.ts +127 -0
- package/dist/schema/piechart.gen.d.ts.map +1 -0
- package/dist/schema/prometheus.gen.d.ts.map +1 -1
- package/dist/schema/stat.gen.d.ts.map +1 -1
- package/dist/schema/statetimeline.gen.d.ts +124 -0
- package/dist/schema/statetimeline.gen.d.ts.map +1 -0
- package/dist/schema/statushistory.gen.d.ts +114 -0
- package/dist/schema/statushistory.gen.d.ts.map +1 -0
- package/dist/schema/table.gen.d.ts +35 -3
- package/dist/schema/table.gen.d.ts.map +1 -1
- package/dist/schema/tempo.gen.d.ts.map +1 -1
- package/dist/schema/text.gen.d.ts.map +1 -1
- package/dist/schema/timeseries.gen.d.ts +5 -1
- package/dist/schema/timeseries.gen.d.ts.map +1 -1
- package/dist/schema/trend.gen.d.ts +180 -0
- package/dist/schema/trend.gen.d.ts.map +1 -0
- package/dist/schema/xychart.gen.d.ts +145 -0
- package/dist/schema/xychart.gen.d.ts.map +1 -0
- package/dist/schema-validate.d.ts +39 -4
- package/dist/schema-validate.d.ts.map +1 -1
- package/dist/serializer.d.ts +11 -3
- package/dist/serializer.d.ts.map +1 -1
- package/dist/skill-defs.d.ts.map +1 -1
- package/dist/skills/chant-grafana-alerting.md +49 -0
- package/dist/skills/chant-grafana-operations.md +108 -0
- package/dist/skills/chant-grafana-provisioning.md +3 -3
- package/dist/skills/chant-grafana.md +15 -8
- package/dist/spec/fetch-units-cli.d.ts +3 -0
- package/dist/spec/fetch-units-cli.d.ts.map +1 -0
- package/dist/spec/overlay.d.ts +43 -0
- package/dist/spec/overlay.d.ts.map +1 -0
- package/dist/spec/schemas.d.ts +21 -13
- 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/spec/units.d.ts +35 -0
- package/dist/spec/units.d.ts.map +1 -0
- package/dist/spec/units.gen.d.ts +2 -0
- package/dist/spec/units.gen.d.ts.map +1 -0
- package/dist/transformations.d.ts +459 -0
- package/dist/transformations.d.ts.map +1 -0
- package/dist/util.d.ts +6 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/validate-alerting.d.ts +65 -0
- package/dist/validate-alerting.d.ts.map +1 -0
- package/dist/validate-output.d.ts +62 -9
- 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 +109 -7
- package/dist/variables.d.ts.map +1 -1
- package/package.json +12 -4
- package/src/actions/actions.test.ts +24 -0
- package/src/actions/grafana.ts +40 -0
- package/src/actions/index.ts +1 -0
- package/src/alerting-build.ts +376 -0
- package/src/alerting.e2e.test.ts +212 -0
- package/src/alerting.test.ts +272 -0
- package/src/alerting.ts +435 -0
- package/src/annotations.ts +84 -0
- package/src/api/apply.test.ts +256 -0
- package/src/api/apply.ts +394 -0
- package/src/api/bind.ts +58 -0
- package/src/api/client.ts +148 -0
- package/src/api/converge.ts +63 -0
- package/src/api/dashboards.ts +247 -0
- package/src/api/datasources.ts +33 -0
- package/src/api/fake-grafana-writes.ts +201 -0
- package/src/api/fake-grafana.ts +190 -0
- package/src/api/folders.ts +339 -0
- package/src/api/library-panels.ts +101 -0
- package/src/build.test.ts +351 -10
- package/src/build.ts +294 -55
- package/src/catalog.ts +104 -2
- package/src/codegen/docs.ts +50 -10
- package/src/codegen/generate.ts +27 -1
- package/src/codegen/schema-types.ts +16 -6
- package/src/composites/agent-dashboard.ts +6 -3
- package/src/composites/catalog.test.ts +2 -2
- package/src/composites/catalog.ts +82 -0
- package/src/composites/composites.test.ts +73 -9
- package/src/composites/index.ts +4 -2
- package/src/composites/queries.e2e.test.ts +374 -0
- package/src/composites/red-dashboard.ts +83 -12
- package/src/composites/shared.ts +14 -2
- package/src/composites/slo-alert-rules.ts +149 -0
- package/src/config.test.ts +61 -0
- package/src/config.ts +138 -0
- package/src/contact-point-secrets.ts +63 -0
- package/src/dashboard.ts +68 -9
- package/src/datasource-refs.test.ts +56 -0
- package/src/datasource-refs.ts +213 -0
- package/src/datasource-settings.test.ts +106 -0
- package/src/datasource-settings.ts +941 -0
- package/src/datasource.ts +123 -11
- package/src/deep-observe-hooks.ts +267 -0
- package/src/deep-observe.test.ts +311 -0
- package/src/deep-observe.ts +187 -0
- package/src/describe-resources.test.ts +271 -0
- package/src/describe-resources.ts +244 -0
- package/src/detect.ts +82 -5
- package/src/export-resources.test.ts +129 -0
- package/src/export-resources.ts +84 -0
- package/src/folder.ts +118 -0
- package/src/generated/lexicon-grafana.json +205 -0
- package/src/import/alerting-roundtrip.test.ts +161 -0
- package/src/import/alerting.ts +500 -0
- package/src/import/edits.ts +95 -0
- package/src/import/embedded.test.ts +45 -0
- package/src/import/embedded.ts +47 -0
- package/src/import/generated-types.e2e.test.ts +130 -0
- package/src/import/generator.test.ts +210 -0
- package/src/import/generator.ts +463 -0
- package/src/import/live-export.ts +264 -0
- package/src/import/mappings.ts +336 -0
- package/src/import/model.ts +117 -0
- package/src/import/normalize-alerting.ts +101 -0
- package/src/import/normalize.test.ts +117 -0
- package/src/import/normalize.ts +393 -0
- package/src/import/parser.test.ts +516 -0
- package/src/import/parser.ts +1387 -0
- package/src/import/report.ts +62 -0
- package/src/import/roundtrip.test.ts +563 -0
- package/src/import/testdata/fixtures.ts +137 -0
- package/src/import/v2.test.ts +292 -0
- package/src/import/v2.ts +804 -0
- package/src/import.e2e.test.ts +31 -84
- package/src/import.test.ts +9 -3
- package/src/index.ts +308 -14
- package/src/init-templates.test.ts +74 -0
- package/src/init-templates.ts +349 -0
- package/src/k8s.test.ts +98 -0
- package/src/k8s.ts +197 -0
- package/src/lint/audit-catalog.ts +68 -3
- package/src/lint/core-lint.test.ts +43 -0
- package/src/lint/post-synth/graf101.ts +3 -3
- package/src/lint/post-synth/graf102.ts +1 -1
- package/src/lint/post-synth/graf104.ts +3 -3
- package/src/lint/post-synth/graf106.ts +3 -3
- package/src/lint/post-synth/graf107.ts +1 -1
- package/src/lint/post-synth/graf108.ts +17 -0
- package/src/lint/post-synth/graf109.ts +17 -0
- package/src/lint/post-synth/graf110.ts +17 -0
- package/src/lint/post-synth/graf111.ts +17 -0
- package/src/lint/post-synth/graf112.ts +17 -0
- package/src/lint/post-synth/graf113.ts +17 -0
- package/src/lint/post-synth/graf114.ts +17 -0
- package/src/lint/post-synth/graf115.ts +17 -0
- package/src/lint/post-synth/grafana-helpers.ts +27 -10
- package/src/lint/post-synth/index.ts +16 -0
- package/src/lint/post-synth/post-synth.test.ts +333 -12
- package/src/lint/rules/literal-secret.ts +60 -6
- package/src/lint/rules/rules.test.ts +27 -0
- package/src/load-cost.test.ts +35 -0
- package/src/lsp/completions.test.ts +5 -0
- package/src/lsp/hover.test.ts +7 -0
- package/src/lsp/hover.ts +8 -1
- package/src/members.ts +68 -0
- package/src/observe.e2e.test.ts +255 -0
- package/src/op/activities/grafana-apply.e2e.test.ts +184 -0
- package/src/op/activities/grafana-apply.test.ts +243 -0
- package/src/op/activities/grafana-apply.ts +197 -0
- package/src/op/activities/index.ts +8 -0
- package/src/op/builders.test.ts +40 -0
- package/src/op/builders.ts +34 -0
- package/src/ownership.ts +122 -0
- package/src/panel-options.ts +66 -0
- package/src/panels.test.ts +53 -0
- package/src/panels.ts +148 -10
- package/src/pin.ts +69 -6
- package/src/plugin.test.ts +12 -2
- package/src/plugin.ts +75 -0
- package/src/promql-check.test.ts +108 -0
- package/src/promql-check.ts +193 -0
- package/src/query-models.ts +94 -0
- package/src/query.test.ts +166 -0
- package/src/query.ts +190 -20
- package/src/schema/azuremonitor.gen.ts +381 -0
- package/src/schema/barchart.gen.ts +221 -0
- package/src/schema/bargauge.gen.ts +111 -0
- package/src/schema/bigquery.gen.ts +110 -0
- package/src/schema/canvas.gen.ts +176 -0
- package/src/schema/cloudwatch.gen.ts +423 -0
- package/src/schema/dashboard.gen.ts +206 -22
- package/src/schema/elasticsearch.gen.ts +508 -0
- package/src/schema/expr.gen.ts +618 -0
- package/src/schema/gauge.gen.ts +2 -1
- package/src/schema/geomap.gen.ts +112 -0
- package/src/schema/googlecloudmonitoring.gen.ts +330 -0
- package/src/schema/grafanapyroscope.gen.ts +66 -0
- package/src/schema/heatmap.gen.ts +2 -1
- package/src/schema/histogram.gen.ts +151 -0
- package/src/schema/index.ts +18 -0
- package/src/schema/logs.gen.ts +3 -1
- package/src/schema/loki.gen.ts +2 -1
- package/src/schema/nodegraph.gen.ts +58 -0
- package/src/schema/piechart.gen.ts +146 -0
- package/src/schema/prometheus.gen.ts +2 -1
- package/src/schema/stat.gen.ts +2 -1
- package/src/schema/statetimeline.gen.ts +143 -0
- package/src/schema/statushistory.gen.ts +132 -0
- package/src/schema/table.gen.ts +41 -4
- package/src/schema/tempo.gen.ts +2 -1
- package/src/schema/text.gen.ts +2 -1
- package/src/schema/timeseries.gen.ts +7 -2
- package/src/schema/trend.gen.ts +208 -0
- package/src/schema/xychart.gen.ts +167 -0
- package/src/schema-overlay.test.ts +282 -0
- package/src/schema-validate.ts +199 -57
- package/src/schema.test.ts +4 -2
- package/src/serializer.test.ts +13 -1
- package/src/serializer.ts +11 -3
- package/src/skill-defs.ts +34 -0
- package/src/skills/chant-grafana-alerting.md +49 -0
- package/src/skills/chant-grafana-operations.md +108 -0
- package/src/skills/chant-grafana-provisioning.md +3 -3
- package/src/skills/chant-grafana.md +15 -8
- package/src/spec/fetch-cli.ts +3 -3
- package/src/spec/fetch-units-cli.ts +37 -0
- package/src/spec/overlay/canvas.overlay.json +142 -0
- package/src/spec/overlay/dashboard.overlay.json +378 -0
- package/src/spec/overlay/expr.overlay.json +14 -0
- package/src/spec/overlay/geomap.overlay.json +35 -0
- package/src/spec/overlay/logs.overlay.json +14 -0
- package/src/spec/overlay/nodegraph.overlay.json +31 -0
- package/src/spec/overlay/piechart.overlay.json +17 -0
- package/src/spec/overlay/table.overlay.json +103 -0
- package/src/spec/overlay/timeseries.overlay.json +21 -0
- package/src/spec/overlay/trend.overlay.json +17 -0
- package/src/spec/overlay/xychart.overlay.json +16 -0
- package/src/spec/overlay.ts +105 -0
- package/src/spec/schemas/azuremonitor.jsonschema.json +679 -0
- package/src/spec/schemas/barchart.jsonschema.json +419 -0
- package/src/spec/schemas/bargauge.jsonschema.json +224 -0
- package/src/spec/schemas/bigquery.jsonschema.json +290 -0
- package/src/spec/schemas/canvas.jsonschema.json +356 -0
- package/src/spec/schemas/cloudwatch.jsonschema.json +721 -0
- package/src/spec/schemas/dashboardv2.jsonschema.json +3387 -0
- package/src/spec/schemas/elasticsearch.jsonschema.json +1695 -0
- package/src/spec/schemas/expr.jsonschema.json +987 -0
- package/src/spec/schemas/geomap.jsonschema.json +220 -0
- package/src/spec/schemas/googlecloudmonitoring.jsonschema.json +488 -0
- package/src/spec/schemas/grafanapyroscope.jsonschema.json +93 -0
- package/src/spec/schemas/histogram.jsonschema.json +308 -0
- package/src/spec/schemas/nodegraph.jsonschema.json +77 -0
- package/src/spec/schemas/piechart.jsonschema.json +275 -0
- package/src/spec/schemas/statetimeline.jsonschema.json +324 -0
- package/src/spec/schemas/statushistory.jsonschema.json +292 -0
- package/src/spec/schemas/trend.jsonschema.json +449 -0
- package/src/spec/schemas/xychart.jsonschema.json +428 -0
- package/src/spec/schemas.gen.ts +40 -0
- package/src/spec/schemas.ts +30 -16
- package/src/spec/units.gen.ts +281 -0
- package/src/spec/units.ts +77 -0
- package/src/transformations.test.ts +65 -0
- package/src/transformations.ts +574 -0
- package/src/util.ts +8 -0
- package/src/validate-alerting.test.ts +255 -0
- package/src/validate-alerting.ts +430 -0
- package/src/validate-output.ts +427 -104
- package/src/validate.ts +28 -0
- package/src/validation.ts +27 -0
- package/src/variables.ts +120 -8
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** How the importers report what they could not carry: warnings, and the edits that make the source equal the rebuilt output. */
|
|
2
|
+
import type { ImportEdit } from "./edits.js";
|
|
3
|
+
/** `a`, `a and b`, `a, b and c`. */
|
|
4
|
+
export declare function list(keys: string[]): string;
|
|
5
|
+
/** Collects edits, and warnings grouped by what they are about. */
|
|
6
|
+
export declare class Report {
|
|
7
|
+
readonly edits: ImportEdit[];
|
|
8
|
+
private readonly headlines;
|
|
9
|
+
private readonly grouped;
|
|
10
|
+
/** A warning of its own. */
|
|
11
|
+
warn(message: string): void;
|
|
12
|
+
/** `key` of `subject`, at `path`, is not carried. No warning when `why` is undefined (it is at Grafana's default). */
|
|
13
|
+
drop(path: string, subject: string, key: string, why?: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* The value at `path` is written as `value`. No warning when `why` is
|
|
16
|
+
* undefined (Grafana reads both the same); otherwise the warning reads
|
|
17
|
+
* `<subject>: <key> <why>`.
|
|
18
|
+
*/
|
|
19
|
+
replace(path: string, value: unknown, subject: string, key: string, why?: string): void;
|
|
20
|
+
edit(edit: ImportEdit): void;
|
|
21
|
+
private note;
|
|
22
|
+
warnings(): string[];
|
|
23
|
+
}
|
|
24
|
+
/** The `why` of a key no prop takes. */
|
|
25
|
+
export declare const NO_PROP = "(no prop takes it)";
|
|
26
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/import/report.ts"],"names":[],"mappings":"AAAA,iIAAiI;AAEjI,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,oCAAoC;AACpC,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAE3C;AAED,mEAAmE;AACnE,qBAAa,MAAM;IACjB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,CAAM;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiG;IAEzH,4BAA4B;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,sHAAsH;IACtH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAKpE;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAKvF,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAI5B,OAAO,CAAC,IAAI;IAOZ,QAAQ,IAAI,MAAM,EAAE;CAWrB;AAED,wCAAwC;AACxC,eAAO,MAAM,OAAO,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const pkgDir: string;
|
|
2
|
+
export declare const repoRoot: string;
|
|
3
|
+
export declare const fixturesDir: string;
|
|
4
|
+
/** A fixture file's text, by path under test/fixtures. */
|
|
5
|
+
export declare const read: (...p: string[]) => string;
|
|
6
|
+
/** The classic UI exports (every export but the v1 and v2 resources), as paths under test/fixtures. */
|
|
7
|
+
export declare const UI_EXPORTS: readonly string[];
|
|
8
|
+
/** v2 dashboards (#2947): the checkout V2 Resource UI export, and the tabs dashboard as the v2 API reads it. */
|
|
9
|
+
export declare const V2_EXPORTS: readonly string[];
|
|
10
|
+
/** The tabs dashboard read at dashboard.grafana.app/v1: Grafana's lossy down-conversion of a dashboard it stores as v2. */
|
|
11
|
+
export declare const LOSSY_V1_EXPORT = "exports/grafana-13.2.2/tabs.v1-resource.json";
|
|
12
|
+
/** The grafana.com dashboards, as paths under test/fixtures. */
|
|
13
|
+
export declare const COMMUNITY: readonly string[];
|
|
14
|
+
/** kube-prometheus v0.19.0's dashboards, one file per dashboard, as paths under test/fixtures. */
|
|
15
|
+
export declare const KUBE_PROMETHEUS: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* Datasource provisioning files (test/fixtures/provisioning/, provenance in
|
|
18
|
+
* its README): one written for chant with every plugin whose settings are
|
|
19
|
+
* typed, and grafana/docker-otel-lgtm's.
|
|
20
|
+
*/
|
|
21
|
+
export declare const PROVISIONING: readonly string[];
|
|
22
|
+
/**
|
|
23
|
+
* The alerting provisioning corpus (test/fixtures/alerting/, provenance and
|
|
24
|
+
* licenses in its README): Grafana 12.4.11 and 13.2.2 exports, and files
|
|
25
|
+
* from projects that provision Grafana alerting from files.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ALERTING: readonly string[];
|
|
28
|
+
/** Every file each example builds, keyed `<example>/<path>`. */
|
|
29
|
+
export declare function exampleOutputs(): Promise<Array<[string, string]>>;
|
|
30
|
+
/** A chant project directory inside the package, so the lexicon resolves as it does for a user. */
|
|
31
|
+
export declare function projectDir(): string;
|
|
32
|
+
/** Write generated files under `dir`, creating their directories. */
|
|
33
|
+
export declare function writeFiles(dir: string, files: ReadonlyArray<{
|
|
34
|
+
path: string;
|
|
35
|
+
content: string;
|
|
36
|
+
}>): string[];
|
|
37
|
+
/** Remove a directory made by `projectDir`. */
|
|
38
|
+
export declare function removeDir(dir: string): void;
|
|
39
|
+
/** Every `.ts` file under a directory, recursively. */
|
|
40
|
+
export declare function tsFiles(dir: string): string[];
|
|
41
|
+
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/import/testdata/fixtures.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,MAAM,QAA2C,CAAC;AAC/D,eAAO,MAAM,QAAQ,QAA2B,CAAC;AACjD,eAAO,MAAM,WAAW,QAAmC,CAAC;AAE5D,0DAA0D;AAC1D,eAAO,MAAM,IAAI,GAAI,GAAG,GAAG,MAAM,EAAE,KAAG,MAAwD,CAAC;AAE/F,uGAAuG;AACvG,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAKvC,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAyG,CAAC;AAElJ,2HAA2H;AAC3H,eAAO,MAAM,eAAe,iDAAiD,CAAC;AAE9E,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EAQtC,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAGR,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAsG,CAAC;AAEjJ;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAKrC,CAAC;AASF,gEAAgE;AAChE,wBAAsB,cAAc,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAWvE;AAED,mGAAmG;AACnG,wBAAgB,UAAU,IAAI,MAAM,CAMnC;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,EAAE,CASzG;AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,uDAAuD;AACvD,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ7C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a v2 dashboard (`dashboard.grafana.app/v2` or `v2beta1`, Grafana 13's
|
|
3
|
+
* default "V2 Resource" export) as the classic (v1) dashboard JSON chant
|
|
4
|
+
* builds, for `chant import` (#2947).
|
|
5
|
+
*
|
|
6
|
+
* The conversion follows Grafana's own v2 -> v1 conversion at v13.2.2
|
|
7
|
+
* (`apps/dashboard/pkg/migration/conversion/v2alpha1_to_v1.go` and
|
|
8
|
+
* `v2_to_v1_layout_conversion.md`), so what comes out is what Grafana itself
|
|
9
|
+
* serves when the same dashboard is read at v1: tabs become expanded rows,
|
|
10
|
+
* an auto grid gets the fixed positions Grafana computes, nested rows are
|
|
11
|
+
* flattened, and row ids follow the largest panel id.
|
|
12
|
+
*
|
|
13
|
+
* Grafana does that silently. Here, everything v2 can say that the classic
|
|
14
|
+
* model cannot is a warning: tabs, auto grids, nested rows, a hidden row
|
|
15
|
+
* header after the first row, conditional rendering, section variables,
|
|
16
|
+
* dashboard preferences, "show in controls menu", and any key the vendored
|
|
17
|
+
* `dashboardv2` schema (`src/spec/schemas/dashboardv2.jsonschema.json`) does
|
|
18
|
+
* not know. `V2_KEYS` names, per schema definition, which keys are carried
|
|
19
|
+
* and which are reported; `v2.test.ts` checks it against the schema, so a
|
|
20
|
+
* pin bump that adds a v2 key fails until the key is placed in one of them.
|
|
21
|
+
*
|
|
22
|
+
* What the classic model can hold but chant cannot yet (library panels,
|
|
23
|
+
* annotations) is written to the classic JSON as Grafana would and reported
|
|
24
|
+
* by the classic importer (`./parser.ts`), as for any classic dashboard. Ad
|
|
25
|
+
* hoc, group by and switch variables are written the same way and imported
|
|
26
|
+
* by the classic importer's variable mappings (`./mappings.ts`).
|
|
27
|
+
*
|
|
28
|
+
* A classic read of a dashboard Grafana stores as v2 is the lossy direction:
|
|
29
|
+
* `storedAsV2` recognises it from the resource's
|
|
30
|
+
* `status.conversion.storedVersion`, and the parser refuses it unless the
|
|
31
|
+
* caller opts in.
|
|
32
|
+
*/
|
|
33
|
+
type Json = Record<string, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Per `dashboardv2` schema definition, the keys this module reads.
|
|
36
|
+
*
|
|
37
|
+
* - `carried`: written into the classic dashboard (or structural, like `kind`).
|
|
38
|
+
* - `reported`: v2-only, with the reason the warning gives when the key is
|
|
39
|
+
* set to anything but its default.
|
|
40
|
+
*/
|
|
41
|
+
export declare const V2_KEYS: Readonly<Record<string, {
|
|
42
|
+
carried: readonly string[];
|
|
43
|
+
reported: Readonly<Record<string, string>>;
|
|
44
|
+
}>>;
|
|
45
|
+
/** What reading one v2 dashboard gave. */
|
|
46
|
+
export interface V2Read {
|
|
47
|
+
/** The classic dashboard JSON. */
|
|
48
|
+
dashboard: Json;
|
|
49
|
+
/** What v2 said that the classic dashboard does not. */
|
|
50
|
+
warnings: string[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Read a v2 dashboard: a `dashboard.grafana.app/v2` or `v2beta1` resource,
|
|
54
|
+
* or a bare v2 spec. Throws for `v2alpha1`, whose panel queries have another
|
|
55
|
+
* shape; Grafana serves every stored dashboard at v2, so the fix is to read
|
|
56
|
+
* it there.
|
|
57
|
+
*/
|
|
58
|
+
export declare function readV2Dashboard(data: Json): V2Read;
|
|
59
|
+
/**
|
|
60
|
+
* The version Grafana stores a dashboard at, when a `dashboard.grafana.app`
|
|
61
|
+
* resource read at v0 or v1 says it is stored as v2 (`status.conversion`):
|
|
62
|
+
* that read is a down-conversion that drops whatever v2 has and v1 does not
|
|
63
|
+
* (tabs, auto grids, conditional rendering), with nothing in the spec to show
|
|
64
|
+
* it. Also returns the stored version when the conversion failed. Undefined
|
|
65
|
+
* for everything else.
|
|
66
|
+
*/
|
|
67
|
+
export declare function lossyV1Read(data: unknown): {
|
|
68
|
+
apiVersion: string;
|
|
69
|
+
storedVersion: string;
|
|
70
|
+
failed: boolean;
|
|
71
|
+
} | undefined;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/import/v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,CAAC,CA8FxH,CAAC;AA2EF,0CAA0C;AAC1C,MAAM,WAAW,MAAM;IACrB,kCAAkC;IAClC,SAAS,EAAE,IAAI,CAAC;IAChB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AA8hBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAgBlD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CASrH"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
export { grafanaPlugin } from "./plugin.js";
|
|
2
2
|
export { grafanaSerializer } from "./serializer.js";
|
|
3
|
-
export { Datasource, DATASOURCE_TYPE, BUILTIN_DATASOURCE_UIDS, isDatasourceEntity, type DatasourceProps, type DatasourceEntity, type DatasourceConstructor, type DatasourceRef, type DatasourceAccess, type KnownDatasourceType, } from "./datasource.js";
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
3
|
+
export { Datasource, DATASOURCE_TYPE, ExternalDatasource, EXTERNAL_DATASOURCE_TYPE, BUILTIN_DATASOURCE_UIDS, isDatasourceEntity, isExternalDatasource, isDatasourceDeclaration, DatasourceProvisioning, DATASOURCE_PROVISIONING_TYPE, isDatasourceProvisioningEntity, type DatasourceProvisioningProps, type DatasourceProvisioningEntity, type DeletedDatasource, type ExternalDatasourceProps, type ExternalDatasourceEntity, type ExternalDatasourceConstructor, type DatasourceProps, type DatasourceEntity, type DatasourceConstructor, type DatasourceRef, type DatasourceAccess, type KnownDatasourceType, } from "./datasource.js";
|
|
4
|
+
export { JSONDATA_LINKS, TRACING_DATASOURCE_TYPES, TRACE_TO_LOGS_DATASOURCE_TYPES, TRACE_TO_METRICS_DATASOURCE_TYPES, type JsonDataLink, type LinkedDatasource, type TracingDatasourceType, type TraceToLogsDatasourceType, type TraceToMetricsDatasourceType, type TypedDatasourceType, type DatasourceJsonData, type DatasourceSecureJsonData, type DatasourceJsonDataTypes, type DatasourceSecureJsonKeys, type CommonJsonData, type HttpJsonData, type HttpSecureJsonKey, type PrometheusJsonData, type ExemplarTraceIdDestination, type LokiJsonData, type DerivedFieldConfig, type TempoJsonData, type TraceToLogsTag, type TraceToLogsOptions, type TraceToLogsOptionsV2, type TraceToMetricsOptions, type TraceToProfilesOptions, type ElasticsearchJsonData, type ElasticsearchDataLink, type ElasticsearchSecureJsonKey, type AwsAuthJsonData, type AwsAuthSecureJsonKey, type CloudWatchJsonData, type CloudWatchLogGroup, type CloudWatchSecureJsonKey, type AzureCloudName, type AzureCredentials, type AzureMonitorJsonData, type AzureMonitorSecureJsonKey, type GoogleAuthJsonData, type GoogleAuthSecureJsonKey, type CloudMonitoringJsonData, type CloudMonitoringSecureJsonKey, type BigQueryJsonData, type BigQuerySecureJsonKey, type PyroscopeJsonData, type PyroscopeSecureJsonKey, type SqlJsonData, type PostgresJsonData, type PostgresSecureJsonKey, type MySQLJsonData, type MySQLSecureJsonKey, type MSSQLJsonData, type MSSQLSecureJsonKey, } from "./datasource-settings.js";
|
|
5
|
+
export { Dashboard, DashboardProvider, DASHBOARD_TYPE, DASHBOARD_PROVIDER_TYPE, DEFAULT_DASHBOARDS_PATH, isDashboardEntity, isDashboardProviderEntity, type DashboardProps, type DashboardEntity, type DashboardLinkInput, type DashboardProviderProps, type DashboardProviderEntity, type DashboardEntityProps, type DashboardProviderEntityProps, } from "./dashboard.js";
|
|
6
|
+
export { Folder, FOLDER_TYPE, isFolderEntity, folderLevels, type FolderProps, type FolderEntity } from "./folder.js";
|
|
7
|
+
export { annotationJson, ANNOTATION_REF_ID, type AnnotationInput } from "./annotations.js";
|
|
8
|
+
export { AlertRuleGroup, AlertRule, AlertQuery, ReduceExpression, MathExpression, ThresholdExpression, ResampleExpression, ClassicConditionsExpression, SqlExpression, ContactPoint, NotificationPolicy, MuteTiming, NotificationTemplate, ALERT_RULE_GROUP_TYPE, ALERT_RULE_TYPE, ALERT_QUERY_TYPE, EXPRESSION_TYPE_PREFIX, EXPRESSION_DATASOURCE_UID, CONTACT_POINT_TYPE, NOTIFICATION_POLICY_TYPE, MUTE_TIMING_TYPE, NOTIFICATION_TEMPLATE_TYPE, isAlertRuleGroupEntity, isAlertRuleEntity, isAlertQueryEntity, isExpressionEntity, isContactPointEntity, isNotificationPolicyEntity, isMuteTimingEntity, isNotificationTemplateEntity, type AlertRuleGroupProps, type AlertRuleGroupEntity, type AlertRuleProps, type AlertRuleEntity, type AlertRuleData, type AlertRuleNotificationSettings, type AlertRuleRecord, type AlertQueryProps, type AlertQueryEntity, type AlertDuration, type RelativeTimeRange, type ExpressionEntity, type ExpressionKind, type ReduceExpressionProps, type MathExpressionProps, type ThresholdExpressionProps, type ResampleExpressionProps, type ClassicConditionsExpressionProps, type SqlExpressionProps, type NoDataState, type ExecErrState, type ContactPointProps, type ContactPointEntity, type ContactPointReceiver, type ContactPointIntegrationType, type NotificationPolicyProps, type NotificationPolicyEntity, type PolicyRoute, type ObjectMatcher, type MuteTimingProps, type MuteTimingEntity, type NotificationTemplateProps, type NotificationTemplateEntity, } from "./alerting.js";
|
|
9
|
+
export { buildAlerting, alertingYaml, alertRuleJson, alertQueryJson, ruleGroupJson, contactPointJson, notificationPolicyJson, muteTimingJson, notificationTemplateJson, durationSeconds, ALERTING_FILE, ALERTING_FILE_KEYS, DEFAULT_RELATIVE_TIME_RANGE, DEFAULT_GROUP_INTERVAL, type AlertingFile, type AlertingIndex, type ProvisionedRuleGroup, type ProvisionedAlertRule, type ProvisionedAlertQuery, type ProvisionedContactPoint, type ProvisionedMuteTiming, type ProvisionedTemplate, } from "./alerting-build.js";
|
|
10
|
+
export { CONTACT_POINT_SECRET_SETTINGS } from "./contact-point-secrets.js";
|
|
11
|
+
export { TimeSeriesPanel, StatPanel, GaugePanel, TablePanel, LogsPanel, TracesPanel, HeatmapPanel, TextPanel, BarChartPanel, BarGaugePanel, PieChartPanel, StateTimelinePanel, StatusHistoryPanel, HistogramPanel, NodeGraphPanel, XYChartPanel, TrendPanel, CanvasPanel, GeomapPanel, FlameGraphPanel, AlertListPanel, Row, definePanel, registeredPanels, panelDefinitionFor, isPanelEntity, isRowEntity, PANEL_TYPE_PREFIX, ROW_TYPE, type PanelProps, type PanelFieldConfig, type PanelLink, type PanelDefinition, type PanelEntity, type PanelClass, type RowProps, type RowEntity, } from "./panels.js";
|
|
12
|
+
export { PromQuery, TempoQuery, LokiQuery, ElasticsearchQuery, CloudWatchQuery, AzureMonitorQuery, CloudMonitoringQuery, BigQueryQuery, PyroscopeQuery, PostgresQuery, MySQLQuery, MSSQLQuery, defineQuery, registeredQueries, queryDefinitionFor, isQueryEntity, QUERY_TYPE_PREFIX, type DatasourceInput, type QueryModel, type Loosen, type MergedModel, type QueryProps, type QueryDefinition, type QueryEntity, type QueryClass, type PromQueryEntity, type TempoQueryEntity, type LokiQueryEntity, type ElasticsearchQueryEntity, type CloudWatchQueryEntity, type AzureMonitorQueryEntity, type CloudMonitoringQueryEntity, type BigQueryQueryEntity, type PyroscopeQueryEntity, type PostgresQueryEntity, type MySQLQueryEntity, type MSSQLQueryEntity, } from "./query.js";
|
|
13
|
+
export type { SqlQueryModel, SqlBuilderQuery, SqlQueryFormat, SqlExpressionType, SqlProperty, SqlFunctionExpression, SqlFunctionParameterExpression, SqlGroupByExpression, SqlPropertyExpression, } from "./query-models.js";
|
|
14
|
+
export { QueryVariable, CustomVariable, IntervalVariable, DatasourceVariable, ConstantVariable, TextboxVariable, isVariableEntity, isDatasourceVariable, isBuiltinVariable, VARIABLE_NAME, VARIABLE_TYPE_PREFIX, type VariableKind, type VariableHide, type VariableEntity, type VariableDatasource, type DatasourceVariableEntity, type QueryVariableProps, type CustomVariableProps, type IntervalVariableProps, type DatasourceVariableProps, type ConstantVariableProps, type TextboxVariableProps, AdhocVariable, GroupByVariable, SwitchVariable, MULTI_VALUE_KINDS, type AdhocVariableProps, type GroupByVariableProps, type SwitchVariableProps, type AdhocFilter, type VariableKeyOption, type VariableQueryObject, type PrometheusVariableQuery, } from "./variables.js";
|
|
8
15
|
export * as schema from "./schema/index.js";
|
|
9
16
|
export { DASHBOARD_SCHEMA_VERSION } from "./schema/index.js";
|
|
10
|
-
export { GRAFANA_SCHEMA_PIN, SCHEMA_NAMES, type GrafanaSchemaPin, type SchemaName } from "./pin.js";
|
|
11
|
-
export
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
+
export { GRAFANA_SCHEMA_PIN, SCHEMA_NAMES, IMPORT_ONLY_SCHEMA_NAMES, VENDORED_SCHEMA_NAMES, type GrafanaSchemaPin, type SchemaName, type ImportOnlySchemaName, type VendoredSchemaName, } from "./pin.js";
|
|
18
|
+
export type { AlertListOptions, AlertListSortOrder, AlertListStateFilter, FlameGraphOptions } from "./panel-options.js";
|
|
19
|
+
export { transformation, customTransformation, TRANSFORMATION_IDS, type Transformation, type KnownTransformation, type CustomTransformation, type TransformationCommon, type TransformationId, type TransformationOptionsById, type ReducerId, } from "./transformations.js";
|
|
20
|
+
export { buildGrafana, grafanaFiles, renderDashboard, dashboardJson, dashboardUid, panelsJson, targetJson, variableModel, customVariableOptions, datasourceRef, provisionedDatasource, externalDatasourceRecord, provisionedProvider, datasourcesYaml, datasourceFileSettings, dashboardProvidersYaml, GRID_COLUMNS, DATASOURCES_FILE, DASHBOARD_PROVIDERS_FILE, DASHBOARDS_DIR, type BuiltGrafana, type BuiltDashboard, type GrafanaIndex, type ProvisionedDatasource, type ExternalDatasourceRecord, type ProvisionedProvider, type DatasourceFileSettings, type DashboardJson, type PanelJson, type RowPanelJson, type VariableModel, type DataSourceRef, } from "./build.js";
|
|
21
|
+
export { datasourceUses, variableReferences, resolveDatasourceRef, knownDatasources, type DatasourceUse, type ResolvedDatasource, type KnownDatasource, type DatasourceRefJson, } from "./datasource-refs.js";
|
|
22
|
+
export { looksLikeDashboard, looksLikeDatasourceProvisioning, looksLikeDashboardProvisioning, looksLikeAlertingProvisioning } from "./detect.js";
|
|
23
|
+
export { slugUid, isValidUid, UID_PATTERN, type DeepPartial, type PropsOf } from "./util.js";
|
|
24
|
+
export { RedDashboard, redQueries, RED_DEFAULT_SPAN_KINDS, SloDashboard, sloQueries, AgentDashboard, agentQueries, type RedDashboardProps, type RedDashboardMembers, type RedDashboardInstance, type SpanKind, type SloDashboardProps, type SloDashboardMembers, type SloDashboardInstance, type AgentDashboardProps, type AgentDashboardMembers, type AgentDashboardInstance, type DashboardOptions, SloAlertRules, sloAlertQueries, type SloAlertRulesProps, type SloAlertRulesMembers, type SloAlertRulesInstance, } from "./composites/index.js";
|
|
25
|
+
export { grafanaConfigSchema, resolveGrafanaTarget } from "./config.js";
|
|
26
|
+
export type { GrafanaConfig, GrafanaProfile } from "./config.js";
|
|
27
|
+
export { GRAFANA_OWNERSHIP_KEYS, DEFAULT_PROVIDER_NAME, grafanaOwnershipLabels, dashboardOwnership, } from "./ownership.js";
|
|
28
|
+
export { GrafanaClient, GrafanaApiError, grafanaHttp, namespaceOf, statusVerdict } from "./api/client.js";
|
|
29
|
+
export type { GrafanaAuth, GrafanaHttp, GrafanaResponse, GrafanaTarget, StatusVerdict } from "./api/client.js";
|
|
30
|
+
export { bindGrafana, classifyGrafanaFailure, GrafanaBindingError } from "./api/bind.js";
|
|
31
|
+
export { grafanaApply } from "./op/builders.js";
|
|
32
|
+
export { applyGrafana, planFromDashboards, GRAFANA_APPLY_KINDS } from "./api/apply.js";
|
|
33
|
+
export type { GrafanaApplyPlan, GrafanaApplyOutcome, DashboardPlan, BuiltDashboardInput } from "./api/apply.js";
|
|
34
|
+
export { folderUidFor, foldersForDashboards, resolveFolders, liveFolderPath, type FolderPlan, type ResolvedFolders } from "./api/folders.js";
|
|
35
|
+
export { GrafanaActions, grafanaActionsFor, type GrafanaAccessLevel } from "./actions/index.js";
|
|
17
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EACL,UAAU,EACV,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAm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,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant init --lexicon grafana` scaffolds.
|
|
3
|
+
*
|
|
4
|
+
* - default: a Prometheus datasource and a job overview dashboard with a
|
|
5
|
+
* typed variable, in a folder.
|
|
6
|
+
* - `red`: rate, errors and duration per service from the OpenTelemetry
|
|
7
|
+
* collector's span metrics, over a Prometheus Grafana already has
|
|
8
|
+
* (`ExternalDatasource`), in a pinned `Folder`.
|
|
9
|
+
* - `k8s-pods`: CPU, memory, restarts and pod phase per namespace, delivered
|
|
10
|
+
* as ConfigMaps the Grafana Helm chart's sidecar loads, from the `/k8s`
|
|
11
|
+
* subpath. Builds with the k8s lexicon.
|
|
12
|
+
* - `slo`: an SLO's recording rules, its dashboard and its burn-rate alerts
|
|
13
|
+
* as Grafana-managed rules. Builds with the prometheus lexicon.
|
|
14
|
+
*
|
|
15
|
+
* The otel, prometheus and k8s lexicons these import are dependencies of
|
|
16
|
+
* the grafana lexicon, so they are installed with it. The templates that
|
|
17
|
+
* build with a second lexicon ship their own `chant.config.ts` and a build
|
|
18
|
+
* script without `--lexicon`, so every lexicon's output and checks run.
|
|
19
|
+
*/
|
|
20
|
+
import type { InitTemplateSet } from "@intentius/chant/lexicon";
|
|
21
|
+
export declare const DEFAULT_TEMPLATE: InitTemplateSet;
|
|
22
|
+
export declare const RED_TEMPLATE: InitTemplateSet;
|
|
23
|
+
export declare const K8S_PODS_TEMPLATE: InitTemplateSet;
|
|
24
|
+
export declare const SLO_TEMPLATE: InitTemplateSet;
|
|
25
|
+
/** The template names `chant init --lexicon grafana --template <name>` takes, besides the default. */
|
|
26
|
+
export declare const TEMPLATE_NAMES: readonly ["red", "k8s-pods", "slo"];
|
|
27
|
+
//# sourceMappingURL=init-templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-templates.d.ts","sourceRoot":"","sources":["../src/init-templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AA8ShE,eAAO,MAAM,gBAAgB,EAAE,eAE9B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,eAE1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAU/B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,eAI1B,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,cAAc,qCAAsC,CAAC"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
5
|
-
"meta.json": "
|
|
4
|
+
"manifest.json": "6b9780bbfbc00f2317658e520c26391d7a7dbfbd01f6e640b6fdf376821e8d18",
|
|
5
|
+
"meta.json": "d30a7da8926eb2970ca428a6df98671533acba9b175ea251ce0b103aaf95bc65",
|
|
6
6
|
"types/index.d.ts": "ad385264290f2486f7a54be205684de8415a25b74eee5b809ca625ae19fb08da",
|
|
7
7
|
"rules/grafana-ast.ts": "51f4fac423f7a5c6d6f577074e95b4a70d4ab0a05883a86e04970a50c63d92e8",
|
|
8
|
-
"rules/literal-secret.ts": "
|
|
8
|
+
"rules/literal-secret.ts": "bc3e13bff3bfa5f4b66f2b43682efb8605ce5ef2fe5c53bca2de07369fca496f",
|
|
9
9
|
"rules/uid-syntax.ts": "ea6fc0053afcdfb50fd6420d6845cba37352a66411d4f06e7e76876b063e7184",
|
|
10
|
-
"rules/graf101.ts": "
|
|
11
|
-
"rules/graf102.ts": "
|
|
10
|
+
"rules/graf101.ts": "cc1c75a890a01b8f5a5e079769d905d810a7943290bed32203364ec1d940d996",
|
|
11
|
+
"rules/graf102.ts": "c05d50461adc8cf6d4e913de77dc1ecdb27e3d0eaa2929fca8757101f58d69ee",
|
|
12
12
|
"rules/graf103.ts": "d4a035f9fb2dad5e6f415c3fd684789517b0fa38455965b79e221ef2c4c443cf",
|
|
13
|
-
"rules/graf104.ts": "
|
|
13
|
+
"rules/graf104.ts": "26f6ec4aa0e138db37d58bfe27f2682be8ac9de0396b953b70b50c01b6d8cf51",
|
|
14
14
|
"rules/graf105.ts": "98264894350f1ce21841922dfefc3dc85abc0ec5c9db91afdfa5c180a8c306f1",
|
|
15
|
-
"rules/graf106.ts": "
|
|
16
|
-
"rules/graf107.ts": "
|
|
17
|
-
"rules/
|
|
18
|
-
"
|
|
19
|
-
"
|
|
15
|
+
"rules/graf106.ts": "21b7402e60b807806f59834689bb5f9f33b8a248c25245beacfc2c3b8f3088f7",
|
|
16
|
+
"rules/graf107.ts": "e43db67d184b967f1f870dd6a4aac8548a54ad5abd0f58080ca68a2d49c2b20c",
|
|
17
|
+
"rules/graf108.ts": "dda5ef25f56af51905aaeb8648733887bf4778b59a19a4ef67979e7180c0df62",
|
|
18
|
+
"rules/graf109.ts": "8b796ee02c0b1bab129805825dee2ef8e0c5afa743a0241d5c251e2b4484039e",
|
|
19
|
+
"rules/graf110.ts": "c79e2f28a2c933be977979f50541ec3f9b3d58bdc239a4d45825f4fabfceb080",
|
|
20
|
+
"rules/graf111.ts": "acd727a91e33526787bb877550d8a3c12674d34b2a660a23fcb20dec0ffebe03",
|
|
21
|
+
"rules/graf112.ts": "cfe779df7f82969b7d7428394d062f46e07540b16889a255b6cb066c7e6e3430",
|
|
22
|
+
"rules/graf113.ts": "81dfb6512e1c0514a5bb105e3fb841110a290c28725ce435283c2c5abd95dd56",
|
|
23
|
+
"rules/graf114.ts": "0732be823ed7d1e6850abffc5374c95c0cfc4c8a3f8490efa1555319cc260587",
|
|
24
|
+
"rules/graf115.ts": "eb6b5cb7b275ab27f9602eb5bdc3e2bc8e698ae6d0ffcd984d71e2315e4d6315",
|
|
25
|
+
"rules/grafana-helpers.ts": "0a538daafb10f32077dd6cda4c03b541f703b0a10abc51bfd241eae9365c9be6",
|
|
26
|
+
"skills/chant-grafana.md": "90cf6fef49ebdf81ba6684f4b4ea5a92ae567d722d45e67de67137d07dddf48f",
|
|
27
|
+
"skills/chant-grafana-provisioning.md": "55bcf20dbd02b74c880dfb682a4fbe047bd4386158781fe9b94fa76715569e7a",
|
|
28
|
+
"skills/chant-grafana-alerting.md": "d9648dc14c848851bdccbe069dac54ad06115066f9466c90c4137d07dde6d4ad",
|
|
29
|
+
"skills/chant-grafana-operations.md": "4235ee74c4faa95b8dcb1926b4cbabb827380c9c13666bf38ef0be0dd2d3bfa2"
|
|
20
30
|
},
|
|
21
|
-
"composite": "
|
|
31
|
+
"composite": "268a39021dbd5a3b56d10f25d0be57225458b54113ac4ef79c2476f7a6c2898d"
|
|
22
32
|
}
|
package/dist/k8s.d.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grafana dashboards and provisioning delivered to Kubernetes as ConfigMaps
|
|
3
|
+
* (#2954), from `@intentius/chant-lexicon-grafana/k8s`.
|
|
4
|
+
*
|
|
5
|
+
* `GrafanaConfigMaps` writes one ConfigMap per dashboard and one for the
|
|
6
|
+
* datasource provisioning file, labelled the way the Grafana Helm chart's
|
|
7
|
+
* sidecar (kiwigrid/k8s-sidecar, also in kube-prometheus-stack) finds them:
|
|
8
|
+
* `grafana_dashboard: "1"` and `grafana_datasource: "1"`. A dashboard's
|
|
9
|
+
* folder goes in the `k8s-sidecar-target-directory` annotation the sidecar
|
|
10
|
+
* reads by default. Each dashboard ConfigMap holds `<uid>.json`, the same
|
|
11
|
+
* text as `dashboardJson(dashboard)`, which is also what the k8s importer
|
|
12
|
+
* turns such a ConfigMap back into (#2962).
|
|
13
|
+
*
|
|
14
|
+
* A Grafana run without the sidecar (a plain Deployment, as in
|
|
15
|
+
* `examples/agent-observability`) mounts the same ConfigMaps with
|
|
16
|
+
* `grafanaVolumes()`, which also needs the dashboard provider file that
|
|
17
|
+
* `GrafanaConfigMaps` writes to a third ConfigMap. The provisioning files go
|
|
18
|
+
* under `/etc/grafana/provisioning` and each dashboard folder is a volume of
|
|
19
|
+
* its own under the provider's path: inside a ConfigMap volume a
|
|
20
|
+
* subdirectory is a symlink, and Grafana's dashboard provider does not
|
|
21
|
+
* follow symlinked directories.
|
|
22
|
+
*
|
|
23
|
+
* This module is the only part of the grafana lexicon that loads the k8s
|
|
24
|
+
* lexicon; nothing else imports it.
|
|
25
|
+
*/
|
|
26
|
+
import { type CompositeInstance } from "@intentius/chant/composite";
|
|
27
|
+
import type { Declarable } from "@intentius/chant/declarable";
|
|
28
|
+
import { ConfigMap } from "@intentius/chant-lexicon-k8s/generated/index";
|
|
29
|
+
/** The label the Grafana Helm chart's sidecar looks for on dashboard ConfigMaps (`sidecar.dashboards.label`). */
|
|
30
|
+
export declare const SIDECAR_DASHBOARD_LABEL = "grafana_dashboard";
|
|
31
|
+
/** The label it looks for on datasource ConfigMaps (`sidecar.datasources.label`). */
|
|
32
|
+
export declare const SIDECAR_DATASOURCE_LABEL = "grafana_datasource";
|
|
33
|
+
/** The annotation the sidecar reads a dashboard's target directory from, by default (its `FOLDER_ANNOTATION`). */
|
|
34
|
+
export declare const SIDECAR_FOLDER_ANNOTATION = "k8s-sidecar-target-directory";
|
|
35
|
+
/** Where Grafana reads provisioning files. */
|
|
36
|
+
export declare const GRAFANA_PROVISIONING_PATH = "/etc/grafana/provisioning";
|
|
37
|
+
export interface GrafanaConfigMapsProps {
|
|
38
|
+
/** The grafana declarations to deliver: dashboards, datasources, `DashboardProvider`s. Anything else is ignored. */
|
|
39
|
+
entities: Iterable<Declarable>;
|
|
40
|
+
namespace?: string;
|
|
41
|
+
/** Prefix of every ConfigMap name. Defaults to `grafana`. */
|
|
42
|
+
name?: string;
|
|
43
|
+
/** Labels added to every ConfigMap, beside the sidecar's. */
|
|
44
|
+
labels?: Record<string, string>;
|
|
45
|
+
/** The dashboard label as `[key, value]`, or `false` for none. Defaults to `["grafana_dashboard", "1"]`. */
|
|
46
|
+
dashboardLabel?: readonly [string, string] | false;
|
|
47
|
+
/** The datasource label as `[key, value]`, or `false` for none. Defaults to `["grafana_datasource", "1"]`. */
|
|
48
|
+
datasourceLabel?: readonly [string, string] | false;
|
|
49
|
+
/** The annotation holding a dashboard's folder, or `false` for none. Defaults to `k8s-sidecar-target-directory`. */
|
|
50
|
+
folderAnnotation?: string | false;
|
|
51
|
+
}
|
|
52
|
+
/** The `metadata.name` of each ConfigMap, and which file it holds. */
|
|
53
|
+
export interface GrafanaConfigMapLayout {
|
|
54
|
+
dashboards: Array<{
|
|
55
|
+
configMap: string;
|
|
56
|
+
key: string;
|
|
57
|
+
folder: string;
|
|
58
|
+
uid: string;
|
|
59
|
+
text: string;
|
|
60
|
+
}>;
|
|
61
|
+
datasources?: {
|
|
62
|
+
configMap: string;
|
|
63
|
+
key: string;
|
|
64
|
+
text: string;
|
|
65
|
+
};
|
|
66
|
+
providers?: {
|
|
67
|
+
configMap: string;
|
|
68
|
+
key: string;
|
|
69
|
+
text: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** Which ConfigMap each file goes in, and under which key. `GrafanaConfigMaps` and `grafanaVolumes` both read it. */
|
|
73
|
+
export declare function grafanaConfigMapLayout(props: Pick<GrafanaConfigMapsProps, "entities" | "name">): GrafanaConfigMapLayout;
|
|
74
|
+
type ConfigMapEntity = InstanceType<typeof ConfigMap> & Declarable;
|
|
75
|
+
export type GrafanaConfigMapsMembers = Record<string, ConfigMapEntity>;
|
|
76
|
+
export type GrafanaConfigMapsInstance = CompositeInstance<GrafanaConfigMapsMembers> & GrafanaConfigMapsMembers;
|
|
77
|
+
/**
|
|
78
|
+
* One ConfigMap per dashboard, one for the datasources and one for the
|
|
79
|
+
* dashboard provider, labelled for the Grafana sidecar. Export the result
|
|
80
|
+
* from a k8s build root; the members are named after the ConfigMaps
|
|
81
|
+
* (`dashboardGenaiAgents`, `datasources`, `dashboardProviders`).
|
|
82
|
+
*/
|
|
83
|
+
export declare const GrafanaConfigMaps: import("@intentius/chant/composite").CompositeDefinition<GrafanaConfigMapsProps, GrafanaConfigMapsMembers>;
|
|
84
|
+
export interface GrafanaVolumesOptions {
|
|
85
|
+
/** Where the dashboard provider reads dashboards. Defaults to `/var/lib/grafana/dashboards`, the provider chant writes by default. */
|
|
86
|
+
dashboardsPath?: string;
|
|
87
|
+
/** Prefix of the volume names. Defaults to `grafana`. */
|
|
88
|
+
volumeName?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface GrafanaVolumes {
|
|
91
|
+
volumes: Array<Record<string, unknown>>;
|
|
92
|
+
volumeMounts: Array<{
|
|
93
|
+
name: string;
|
|
94
|
+
mountPath: string;
|
|
95
|
+
readOnly: true;
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The pod volumes and container mounts that put `GrafanaConfigMaps`'s files
|
|
100
|
+
* where a Grafana without the sidecar reads them: the provisioning files
|
|
101
|
+
* under `/etc/grafana/provisioning`, and each dashboard folder under the
|
|
102
|
+
* provider's path, one projected volume per folder. Pass the same `entities`
|
|
103
|
+
* and `name` as to `GrafanaConfigMaps`.
|
|
104
|
+
*/
|
|
105
|
+
export declare function grafanaVolumes(props: Pick<GrafanaConfigMapsProps, "entities" | "name">, options?: GrafanaVolumesOptions): GrafanaVolumes;
|
|
106
|
+
export {};
|
|
107
|
+
//# sourceMappingURL=k8s.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"k8s.d.ts","sourceRoot":"","sources":["../src/k8s.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAIzE,iHAAiH;AACjH,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,qFAAqF;AACr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AAC,sBAAsB,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG,sBAAsB,CAuBvH;AAGD,KAAK,eAAe,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,GAAG,UAAU,CAAC;AAEnE,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AACvE,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,wBAAwB,CAAC,GAAG,wBAAwB,CAAC;AAS/G;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,4GAyBP,CAAC;AAExB,MAAM,WAAW,qBAAqB;IACpC,sIAAsI;IACtI,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxC,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;CAC1E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,MAAM,CAAC,EAAE,OAAO,GAAE,qBAA0B,GAAG,cAAc,CA2B5I"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* The grafana lexicon's chant audit catalog, contributed via
|
|
3
3
|
* `grafanaPlugin.auditCatalog()` (#687, #1346).
|
|
4
4
|
*
|
|
5
|
-
* GRAF101-
|
|
5
|
+
* GRAF101-GRAF110, GRAF111-GRAF114 and GRAF115 read the emitted dashboard
|
|
6
|
+
* JSON and provisioning files (alerting included), so
|
|
6
7
|
* they fire on an audit of files chant didn't build too, and are
|
|
7
8
|
* `yamlBased`. GRAF001 and GRAF002 read TypeScript source, so they are
|
|
8
9
|
* constructed with `yamlBased: false`; they are listed for a reader who
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAM1E,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAqIxD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GRAF101: A panel, query or
|
|
2
|
+
* GRAF101: A panel, query, variable or annotation uses a datasource no Datasource or ExternalDatasource in the build declares, or one the build deletes
|
|
3
3
|
*
|
|
4
|
-
* Grafana shows "datasource not found" on the panel. Typed references cannot go wrong this way, so it mostly catches a { type, uid } ref or a hand-edited dashboard. A panel with queries and no datasource at all is a warning: Grafana sends them to its default datasource. This check joins dashboards against the
|
|
4
|
+
* Grafana shows "datasource not found" on the panel. Typed references cannot go wrong this way, so it mostly catches a { type, uid } ref or a hand-edited dashboard. A datasource variable whose plugin type no declared datasource has is an error too. A panel with queries and no datasource at all is a warning: Grafana sends them to its default datasource. This check joins dashboards against the datasources of the same build root (chant #1939): declare one that exists in Grafana but is provisioned elsewhere with ExternalDatasource, which the check counts and the build never provisions. A build that declares no datasource at all gets one warning per dashboard that references any, since nothing can be checked.
|
|
5
5
|
*/
|
|
6
6
|
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
7
|
export declare const graf101: PostSynthCheck;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GRAF102: A query is sent to a datasource of another plugin type
|
|
3
3
|
*
|
|
4
|
-
* A PromQL query sent to Tempo fails at query time. The typed classes prevent this at compile time; the check catches refs, datasource variables of the wrong plugin type and hand-edited dashboards. Like GRAF101 it joins against the Datasource declarations of the same build root
|
|
4
|
+
* A PromQL query sent to Tempo fails at query time. The typed classes prevent this at compile time; the check catches refs, datasource variables of the wrong plugin type and hand-edited dashboards. Like GRAF101 it joins against the Datasource and ExternalDatasource declarations of the same build root (chant #1939).
|
|
5
5
|
*/
|
|
6
6
|
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
7
|
export declare const graf102: PostSynthCheck;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GRAF104: Two dashboards, datasources, panels, variables or queries share an id
|
|
2
|
+
* GRAF104: Two dashboards, datasources, folders, panels, variables or queries share an id
|
|
3
3
|
*
|
|
4
|
-
* Dashboard
|
|
4
|
+
* Dashboard, folder and datasource uids and datasource names must be unique across the build, panel ids and variable names within a dashboard, and refIds within a panel. Grafana keeps one of two dashboards with the same uid and silently drops the other.
|
|
5
5
|
*/
|
|
6
6
|
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
7
|
export declare const graf104: PostSynthCheck;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GRAF106: A dashboard or datasource uid Grafana rejects, or a dashboard with no title
|
|
2
|
+
* GRAF106: A dashboard, folder or datasource uid Grafana rejects, or a dashboard with no title
|
|
3
3
|
*
|
|
4
|
-
* Grafana accepts uids of 1-40 letters, digits, - and _, and refuses to save a dashboard without a title.
|
|
4
|
+
* Grafana accepts uids of 1-40 letters, digits, - and _, refuses the folder uid general (its root), and refuses to save a dashboard without a title.
|
|
5
5
|
*/
|
|
6
6
|
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
7
|
export declare const graf106: PostSynthCheck;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GRAF107: A dashboard does not match the pinned Grafana schema
|
|
3
3
|
*
|
|
4
|
-
* The dashboard is validated against the dashboard schema at GRAFANA_SCHEMA_PIN, and each panel's options, fieldConfig.defaults.custom and queries against their plugin's schema with required fields relaxed (Grafana fills those in).
|
|
4
|
+
* The dashboard is validated against the dashboard schema at GRAFANA_SCHEMA_PIN, with the correction overlay in src/spec/overlay/ applied, and each panel's options, fieldConfig.defaults.custom and queries against their plugin's schema with required fields relaxed (Grafana fills those in). Library panel models embedded in an export's __elements are checked the same way. A value the schema does not allow is an error: the edits Grafana would otherwise need on import. A key the schema does not know is a warning, since newer Grafana versions add keys before the pin catches up.
|
|
5
5
|
*/
|
|
6
6
|
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
7
|
export declare const graf107: PostSynthCheck;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GRAF108: A query sent to Prometheus is not valid PromQL
|
|
3
|
+
*
|
|
4
|
+
* Each panel query, query variable and alert rule query whose datasource resolves to a prometheus datasource is parsed with the prometheus lexicon's checkPromql (@prometheus-io/lezer-promql), after its template variables ($var, ${var}, [[var]], $__interval, $__rate_interval, $__range and the other $__ macros) are replaced with placeholders that parse where they stand. A query whose datasource can't be told is not parsed; an alert rule query is parsed when its datasourceUid is a declared prometheus datasource or its model says `datasource.type: prometheus`. It is a syntax check: an unbalanced bracket or a bad duration fails, rate over an instant vector does not.
|
|
5
|
+
*/
|
|
6
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
|
+
export declare const graf108: PostSynthCheck;
|
|
8
|
+
//# sourceMappingURL=graf108.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graf108.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/graf108.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GRAF109: Dashboard provisioning puts a dashboard somewhere other than its declared folder, or loads it twice
|
|
3
|
+
*
|
|
4
|
+
* Read from the dashboard provisioning file and where each dashboard file sits under dashboards/. Two providers in one org whose paths are the same or nested load every dashboard twice, and Grafana then takes database writes away from both: an error. A provider that sets folder and folderUid with foldersFromFilesStructure is refused by Grafana: an error; with one of them, that folder is ignored: a warning. Dashboards that declare a folder when no provider sets foldersFromFilesStructure all land in the provider's folder: a warning. A nested folder ("Platform/Kubernetes") is a warning: Grafana 13.1 and later nest the folders, 12.4 and 13.0 use only the last level; past Grafana's default depth of 4 it says so, and past its hard limit of 7 it is an error.
|
|
5
|
+
*/
|
|
6
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
|
+
export declare const graf109: PostSynthCheck;
|
|
8
|
+
//# sourceMappingURL=graf109.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graf109.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/graf109.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GRAF110: A panel or row repeats over a variable that cannot give it more than one value
|
|
3
|
+
*
|
|
4
|
+
* Grafana repeats a panel or row once per selected value of a query, custom, datasource or group by variable. Over an ad hoc, constant, interval, textbox or switch variable it shows the panel once and logs an error; over a query, custom or datasource variable with neither multi nor includeAll there is only ever one value. A repeat naming no variable is GRAF103.
|
|
5
|
+
*/
|
|
6
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
|
+
export declare const graf110: PostSynthCheck;
|
|
8
|
+
//# sourceMappingURL=graf110.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graf110.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/graf110.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GRAF111: An alert rule's condition, expression inputs or refIds do not fit together
|
|
3
|
+
*
|
|
4
|
+
* Each alert rule's condition, each server-side expression's inputs (a reduce, threshold or resample `expression`, the `$A` references of a math expression, a classic condition's query) and a recording rule's record.from must name a refId of the same rule; refIds must be unique, and a rule needs a condition unless it records. Each expression model is also validated against the pinned `expr` schema (a missing reducer, an unknown evaluator type). Grafana refuses such a rule, and a refused rule stops it provisioning every alerting file at startup.
|
|
5
|
+
*/
|
|
6
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
|
+
export declare const graf111: PostSynthCheck;
|
|
8
|
+
//# sourceMappingURL=graf111.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graf111.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/graf111.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GRAF112: An alert rule queries a datasource the build does not declare, or of another type
|
|
3
|
+
*
|
|
4
|
+
* Each alert rule query's datasourceUid must be a datasource the build declares: a Datasource it provisions or an ExternalDatasource that already exists in Grafana. A query whose model states a datasource type (model.datasource.type) must match the declared type, and a recording rule's targetDatasourceUid must be a declared Prometheus datasource. With no datasource declared at all, it warns once that it cannot check.
|
|
5
|
+
*/
|
|
6
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
7
|
+
export declare const graf112: PostSynthCheck;
|
|
8
|
+
//# sourceMappingURL=graf112.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graf112.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/graf112.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|