@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 @@
|
|
|
1
|
+
{"version":3,"file":"datasource-settings.d.ts","sourceRoot":"","sources":["../src/datasource-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAErH;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,wCAAyC,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,8BAA8B,4MAQjC,CAAC;AACX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,gHAAgH;AAChH,eAAO,MAAM,iCAAiC,+DAAgE,C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19 @@
|
|
|
7
7
|
* be pointed at a Tempo datasource without a type error.
|
|
8
8
|
*/
|
|
9
9
|
import type { Declarable } from "@intentius/chant/declarable";
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import type { DatasourceJsonData, DatasourceSecureJsonData, TypedDatasourceType } from "./datasource-settings.js";
|
|
11
|
+
/**
|
|
12
|
+
* Datasource plugin types this lexicon types queries and settings for
|
|
13
|
+
* (`postgres` is the PostgreSQL plugin's old id). Any other plugin id is
|
|
14
|
+
* accepted as a string.
|
|
15
|
+
*/
|
|
16
|
+
export type KnownDatasourceType = TypedDatasourceType;
|
|
12
17
|
/** How Grafana reaches the datasource: through its backend (`proxy`) or from the browser (`direct`). */
|
|
13
18
|
export type DatasourceAccess = "proxy" | "direct";
|
|
14
19
|
export interface DatasourceProps<T extends string = string> {
|
|
15
20
|
/** Display name, unique within the Grafana organisation. */
|
|
16
21
|
name: string;
|
|
17
|
-
/** The datasource plugin id, e.g. `prometheus`, `tempo`, `loki`. */
|
|
22
|
+
/** The datasource plugin id, e.g. `prometheus`, `tempo`, `loki`, `grafana-postgresql-datasource`. */
|
|
18
23
|
type: T;
|
|
19
24
|
/** Stable id panels refer to. Defaults to the name as a uid (`Prometheus` becomes `prometheus`). */
|
|
20
25
|
uid?: string;
|
|
@@ -27,17 +32,20 @@ export interface DatasourceProps<T extends string = string> {
|
|
|
27
32
|
database?: string;
|
|
28
33
|
withCredentials?: boolean;
|
|
29
34
|
/**
|
|
30
|
-
* Plugin settings
|
|
31
|
-
*
|
|
32
|
-
*
|
|
35
|
+
* Plugin settings, typed for the plugins in `DatasourceJsonDataTypes`
|
|
36
|
+
* (`./datasource-settings.ts`) and any object for others. A declared
|
|
37
|
+
* `Datasource` anywhere in here is written as its uid, so
|
|
38
|
+
* `tracesToLogsV2: { datasourceUid: loki }` links Tempo to a declared Loki;
|
|
39
|
+
* a typed field that names a datasource accepts only the plugin types
|
|
40
|
+
* Grafana offers there.
|
|
33
41
|
*/
|
|
34
|
-
jsonData?:
|
|
42
|
+
jsonData?: DatasourceJsonData<T>;
|
|
35
43
|
/**
|
|
36
|
-
* Secrets. Write them as Grafana provisioning
|
|
37
|
-
* (`$__env{NAME}`, `$__file{/path}`, `${NAME}`), not as
|
|
38
|
-
* flags a literal.
|
|
44
|
+
* Secrets, by the keys the plugin reads. Write them as Grafana provisioning
|
|
45
|
+
* expands them (`$__env{NAME}`, `$__file{/path}`, `${NAME}`), not as
|
|
46
|
+
* literals: GRAF002 flags a literal.
|
|
39
47
|
*/
|
|
40
|
-
secureJsonData?:
|
|
48
|
+
secureJsonData?: DatasourceSecureJsonData<T>;
|
|
41
49
|
/** Whether users may edit the provisioned datasource in the UI. Defaults to false. */
|
|
42
50
|
editable?: boolean;
|
|
43
51
|
orgId?: number;
|
|
@@ -57,6 +65,35 @@ export interface DatasourceConstructor {
|
|
|
57
65
|
/** A Grafana datasource, provisioned from `provisioning/datasources/chant.yaml`. */
|
|
58
66
|
export declare const Datasource: DatasourceConstructor;
|
|
59
67
|
export declare function isDatasourceEntity(value: unknown): value is DatasourceEntity;
|
|
68
|
+
export declare const EXTERNAL_DATASOURCE_TYPE = "Grafana::ExternalDatasource";
|
|
69
|
+
export interface ExternalDatasourceProps<T extends string = string> {
|
|
70
|
+
/** The datasource plugin id, e.g. `prometheus`. */
|
|
71
|
+
type: T;
|
|
72
|
+
/** The uid the datasource already has in Grafana. */
|
|
73
|
+
uid: string;
|
|
74
|
+
/** Its display name in Grafana, for messages and for a `DatasourceVariable` `regex`. */
|
|
75
|
+
name?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ExternalDatasourceEntity<T extends string = string> extends Declarable {
|
|
78
|
+
readonly props: ExternalDatasourceProps<T>;
|
|
79
|
+
/** The plugin id. */
|
|
80
|
+
readonly datasourceType: T;
|
|
81
|
+
/** The uid panels will reference. */
|
|
82
|
+
readonly uid: string;
|
|
83
|
+
}
|
|
84
|
+
export interface ExternalDatasourceConstructor {
|
|
85
|
+
new <T extends string>(props: ExternalDatasourceProps<T>): ExternalDatasourceEntity<T>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A datasource that already exists in Grafana: provisioned by hand, by
|
|
89
|
+
* another build root, or by another tool. It is never written to the
|
|
90
|
+
* provisioning file. Panels, queries and variables use it like a
|
|
91
|
+
* `Datasource`, and GRAF101/GRAF102 check references against it.
|
|
92
|
+
*/
|
|
93
|
+
export declare const ExternalDatasource: ExternalDatasourceConstructor;
|
|
94
|
+
export declare function isExternalDatasource(value: unknown): value is ExternalDatasourceEntity;
|
|
95
|
+
/** A declared or an external datasource: anything a panel can hold that has a fixed uid. */
|
|
96
|
+
export declare function isDatasourceDeclaration(value: unknown): value is DatasourceEntity | ExternalDatasourceEntity;
|
|
60
97
|
/** A datasource declared somewhere this build can't see, named by its Grafana ref. */
|
|
61
98
|
export interface DatasourceRef<T extends string = string> {
|
|
62
99
|
type: T;
|
|
@@ -64,4 +101,38 @@ export interface DatasourceRef<T extends string = string> {
|
|
|
64
101
|
}
|
|
65
102
|
/** Grafana's own pseudo-datasources, which need no declaration. */
|
|
66
103
|
export declare const BUILTIN_DATASOURCE_UIDS: ReadonlySet<string>;
|
|
104
|
+
export declare const DATASOURCE_PROVISIONING_TYPE = "Grafana::DatasourceProvisioning";
|
|
105
|
+
/** A datasource the provisioning file deletes, by its name in an organisation. */
|
|
106
|
+
export interface DeletedDatasource {
|
|
107
|
+
name: string;
|
|
108
|
+
/** Defaults to 1, as in Grafana. */
|
|
109
|
+
orgId?: number;
|
|
110
|
+
}
|
|
111
|
+
export interface DatasourceProvisioningProps {
|
|
112
|
+
/**
|
|
113
|
+
* Written as the file's `prune`. Grafana marks every datasource this file
|
|
114
|
+
* provisions as prunable, and deletes a prunable datasource once no
|
|
115
|
+
* provisioning file lists it any more, so removing a `Datasource` removes
|
|
116
|
+
* it from Grafana on the next provisioning run. Datasources provisioned
|
|
117
|
+
* without it, or made in the UI or API, are never pruned. Defaults to
|
|
118
|
+
* true; set false to keep a removed datasource in Grafana.
|
|
119
|
+
*/
|
|
120
|
+
prune?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Written as the file's `deleteDatasources`: Grafana deletes these by name
|
|
123
|
+
* before it provisions the file's datasources. Name one the file also
|
|
124
|
+
* provisions to have Grafana re-create it from the file on every run.
|
|
125
|
+
*/
|
|
126
|
+
deleteDatasources?: DeletedDatasource[];
|
|
127
|
+
}
|
|
128
|
+
export interface DatasourceProvisioningEntity extends Declarable {
|
|
129
|
+
readonly props: DatasourceProvisioningProps;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The settings of the datasource provisioning file itself: `prune` and
|
|
133
|
+
* `deleteDatasources`. Optional: without one the file prunes. Declare at
|
|
134
|
+
* most one per build.
|
|
135
|
+
*/
|
|
136
|
+
export declare const DatasourceProvisioning: new (props: DatasourceProvisioningProps) => DatasourceProvisioningEntity;
|
|
137
|
+
export declare function isDatasourceProvisioningEntity(value: unknown): value is DatasourceProvisioningEntity;
|
|
67
138
|
//# sourceMappingURL=datasource.d.ts.map
|
package/dist/datasource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../src/datasource.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../src/datasource.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE/G;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEtD,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,CAAC;A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M,CAA2E,CAAC;AAEpI,eAAO,MAAM,4BAA4B,oCAAoC,CAAC;AAE9E,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,QAAQ,CAAC,KAAK,EAAE,2BAA2B,CAAC;CAC7C;AAID;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAEnB,KAAK,KAAK,EAAE,2BAA2B,KAAK,4BAA4B,CAAC;AAGzF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,4BAA4B,CAOpG"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grafana deep-observation noise rules (#2946).
|
|
3
|
+
*
|
|
4
|
+
* Plain data on the plugin, because core applies the same rules to the
|
|
5
|
+
* declared tree (a `Dashboard`'s props, panels and queries inlined), which
|
|
6
|
+
* no reader touches. The live tree is the stored dashboard put back into the
|
|
7
|
+
* same vocabulary by the importer (./import/live-export.ts), so what is left
|
|
8
|
+
* to name here is what the translation cannot decide: values the build
|
|
9
|
+
* wrote that the author did not, values Grafana adds or drops on save, and
|
|
10
|
+
* values an author wrote out that are also what happens when they are left
|
|
11
|
+
* out.
|
|
12
|
+
*
|
|
13
|
+
* Measured against Grafana 12.4.11 and 13.2.2 (the e2e in
|
|
14
|
+
* ./observe.e2e.test.ts): read over `/api/dashboards/uid`, a stored dashboard
|
|
15
|
+
* differs from the built one only by the `id` and `version` Grafana adds
|
|
16
|
+
* (../test/e2e/stored-model.ts). Read over `/apis/dashboard.grafana.app`, its
|
|
17
|
+
* spec has no `id` or `version`, but it carries the built-in "Annotations &
|
|
18
|
+
* Alerts" annotation, and empty `options` and `fieldConfig` and every `null`
|
|
19
|
+
* are gone. The rest of this table is the build's own choices: panel ids,
|
|
20
|
+
* grid positions, query refIds, a panel's datasource taken from its queries.
|
|
21
|
+
*
|
|
22
|
+
* Every rule is one of four kinds, and they are in this order below:
|
|
23
|
+
*
|
|
24
|
+
* 1. **Never compared**, on either side: Grafana's bookkeeping.
|
|
25
|
+
* 2. **Empty is absent**, on both sides: `null`, `{}` and `[]` mean the same
|
|
26
|
+
* as leaving a key out, everywhere in a dashboard or datasource. The cost
|
|
27
|
+
* is that values added where the declaration wrote `[]` are reported as
|
|
28
|
+
* unclaimed rather than as drift.
|
|
29
|
+
* 3. **Build-derived**, on the live side where the declaration has nothing:
|
|
30
|
+
* the build filled it in, so it cannot disagree with what was declared.
|
|
31
|
+
* 4. **Default written out**, on the declared side where the live side has
|
|
32
|
+
* nothing: the author wrote the value Grafana assumes, which the
|
|
33
|
+
* translation leaves out.
|
|
34
|
+
*
|
|
35
|
+
* Rules 3 and 4 are gated on `counterpart === "absent"`, so a value the
|
|
36
|
+
* author did declare is always compared, and a change away from it is drift.
|
|
37
|
+
* (That relies on core walking a panel's props when it lists the declared
|
|
38
|
+
* paths, which #2946 fixed in `deepPathSet`.)
|
|
39
|
+
*/
|
|
40
|
+
import type { DeepNormalizationHooks } from "@intentius/chant/deep-observation";
|
|
41
|
+
type Json = Record<string, unknown>;
|
|
42
|
+
/** Where a node sits in a dashboard tree, from its index-erased pattern. */
|
|
43
|
+
type Level = "dashboard" | "panel" | "target" | "variable" | "link" | "annotation";
|
|
44
|
+
/**
|
|
45
|
+
* Defaults in the props vocabulary: a key an author may write at this value,
|
|
46
|
+
* and the translation leaves out because Grafana assumes it. The dashboard
|
|
47
|
+
* and panel entries mirror `DASHBOARD_DEFAULTS` and `PANEL_DEFAULTS` in
|
|
48
|
+
* ./import/normalize.ts, with `graphTooltip` spelled as `Dashboard` takes it.
|
|
49
|
+
*/
|
|
50
|
+
export declare const PROP_DEFAULTS: Readonly<Record<Level, Readonly<Json>>>;
|
|
51
|
+
/**
|
|
52
|
+
* Keys the build fills in when a declaration leaves them out, by level:
|
|
53
|
+
* the dashboard's uid (from its export name) and schema version, a panel's
|
|
54
|
+
* id, grid position and datasource (from its queries), a query's refId.
|
|
55
|
+
* Grafana keeps what the build wrote, so undeclared, they read back as the
|
|
56
|
+
* build's choice rather than as anybody's edit.
|
|
57
|
+
*
|
|
58
|
+
* `timezone` is here as a value, not a key: chant writes `browser` for a
|
|
59
|
+
* dashboard that names none, where Grafana's own default is `""`.
|
|
60
|
+
*/
|
|
61
|
+
export declare const BUILD_DERIVED: Readonly<Record<Level, ReadonlySet<string>>>;
|
|
62
|
+
export declare const grafanaDeepNormalizationHooks: DeepNormalizationHooks;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=deep-observe-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-observe-hooks.d.ts","sourceRoot":"","sources":["../src/deep-observe-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EAA8B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAS5G,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC,4EAA4E;AAC5E,KAAK,KAAK,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC;AAqBnF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAiDjE,CAAC;AAKF;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAQtE,CAAC;AAwFF,eAAO,MAAM,6BAA6B,EAAE,sBA2B3C,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grafana deep observation (#2946): the property tree of each declared
|
|
3
|
+
* dashboard and datasource as Grafana holds it, so a dashboard edited in the
|
|
4
|
+
* UI shows up in `chant lifecycle diff --live` path by path.
|
|
5
|
+
*
|
|
6
|
+
* The read is the thin read's (./describe-resources.ts): same binding, same
|
|
7
|
+
* discovered API, same uid. What differs is what is done with the answer.
|
|
8
|
+
*
|
|
9
|
+
* - A dashboard's stored JSON goes through the importer
|
|
10
|
+
* (./import/live-export.ts `dashboardTree`), which puts it into the
|
|
11
|
+
* vocabulary its declaration is written in: `graphTooltip:
|
|
12
|
+
* "sharedCrosshair"` rather than `1`, rows holding their panels, queries
|
|
13
|
+
* without the refIds the build numbered. Core then diffs that against the
|
|
14
|
+
* declaration's props, normalized on both sides by
|
|
15
|
+
* ./deep-observe-hooks.ts.
|
|
16
|
+
* - A dashboard Grafana stores as v2 is read at v2 and converted to the
|
|
17
|
+
* classic JSON the importer makes of it (#2947), so the tree is
|
|
18
|
+
* diffed against the declaration: a tab added in the UI is a row that
|
|
19
|
+
* the declaration does not have.
|
|
20
|
+
* - The folder is not in the JSON. It is read from the resource's folder
|
|
21
|
+
* and written as its path, its titles from the root joined with `/`, the
|
|
22
|
+
* form `Dashboard.folder` takes (a `Folder` given for it is held as its
|
|
23
|
+
* path too); when the declared path is one the build had to rewrite to
|
|
24
|
+
* make directories (` Ops / Team ` becomes `Ops/Team`), the declared
|
|
25
|
+
* spelling is kept, since the two name the same folder.
|
|
26
|
+
* - A `Folder` is read by its uid: its title, and its parent's uid when it
|
|
27
|
+
* is nested. A declared `parent` is a reference, which core does not
|
|
28
|
+
* compare, so a folder moved to another parent shows as drift on the
|
|
29
|
+
* dashboards it holds, whose paths change.
|
|
30
|
+
* - A datasource's API payload is put into `DatasourceProps` vocabulary,
|
|
31
|
+
* secrets as key names only.
|
|
32
|
+
*
|
|
33
|
+
* Tri-state, one level down: a dashboard that is not there is left out (the
|
|
34
|
+
* thin read reports it missing); one that cannot be read (a failed
|
|
35
|
+
* request, withheld by `owned`, a v2-stored dashboard the server cannot
|
|
36
|
+
* serve at v2) is NOT-OBSERVED with its reason; a
|
|
37
|
+
* provider has no API and is `unsupported-kind`. Nothing unreadable comes
|
|
38
|
+
* back as a clean tree. A declared panel, row, query or variable has no tree
|
|
39
|
+
* of its own (./members.ts): its properties are in its dashboard's.
|
|
40
|
+
*/
|
|
41
|
+
import type { DeepObservationResult } from "@intentius/chant/lexicon";
|
|
42
|
+
import { grafanaDeepNormalizationHooks } from "./deep-observe-hooks.js";
|
|
43
|
+
import { type GrafanaObserveOptions } from "./describe-resources.js";
|
|
44
|
+
export { grafanaDeepNormalizationHooks };
|
|
45
|
+
/** Read the live property tree of every declared grafana entity. */
|
|
46
|
+
export declare function observeResourcesDeepGrafana(options: GrafanaObserveOptions): Promise<DeepObservationResult>;
|
|
47
|
+
//# sourceMappingURL=deep-observe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-observe.d.ts","sourceRoot":"","sources":["../src/deep-observe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAA6C,MAAM,0BAA0B,CAAC;AAWjH,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAqD,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAKrH,OAAO,EAAE,6BAA6B,EAAE,CAAC;AAqEzC,oEAAoE;AACpE,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0DhH"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `describeResources()` for grafana (#2946): does each declared dashboard
|
|
3
|
+
* and datasource exist in the environment's Grafana, and whose is it.
|
|
4
|
+
*
|
|
5
|
+
* Runs on core's observer harness. `bind()` resolves the environment's
|
|
6
|
+
* Grafana (`grafana.profiles.<env>`, else `GRAFANA_URL`) and discovers which
|
|
7
|
+
* dashboard API it serves; each entity is one GET, by the uid the build gives
|
|
8
|
+
* it. Verdicts:
|
|
9
|
+
*
|
|
10
|
+
* | Entity | Read | 404 | Not readable |
|
|
11
|
+
* |---|---|---|---|
|
|
12
|
+
* | `Dashboard` | `/apis/dashboard.grafana.app/<v>/.../dashboards/<uid>` (Grafana 11: `/api/dashboards/uid/<uid>`) | absent | a v2-stored dashboard the server does not serve at v2: `unsupported-kind` |
|
|
13
|
+
* | `Datasource`, `ExternalDatasource` | `/api/datasources/uid/<uid>` | absent | |
|
|
14
|
+
* | `Folder` | `/apis/folder.grafana.app/<v>/.../folders/<uid>` (Grafana 11: `/api/folders/<uid>`) | absent | |
|
|
15
|
+
* | a panel, row, query or variable | its dashboard's read (./members.ts) | its dashboard's | its dashboard's |
|
|
16
|
+
* | `DashboardProvider` | none: a provisioning-file setting Grafana serves no API for | | `unsupported-kind` |
|
|
17
|
+
*
|
|
18
|
+
* A dashboard Grafana stores as v2 is read at v2 and converted (#2947);
|
|
19
|
+
* its metadata says `schema: "v2"` and lists what the classic form cannot
|
|
20
|
+
* hold under `v2Lossy`.
|
|
21
|
+
*
|
|
22
|
+
* A refused token is `no-credentials` for every entity, a missing binding
|
|
23
|
+
* `no-binding`, anything else `read-failed`, never absent.
|
|
24
|
+
*
|
|
25
|
+
* Ownership is read where Grafana has a channel (./ownership.ts): a
|
|
26
|
+
* dashboard over `/apis` resolves `owned` or `foreign`; a dashboard over the
|
|
27
|
+
* legacy API and every datasource say `unknown`, and an `owned: true` read
|
|
28
|
+
* withholds them as `filtered`, since it cannot show they are chant's.
|
|
29
|
+
*/
|
|
30
|
+
import { type DescribeResourcesResult } from "@intentius/chant/observation";
|
|
31
|
+
import { type BindOptions } from "./api/bind.js";
|
|
32
|
+
export interface GrafanaObserveOptions extends Omit<BindOptions, "environment"> {
|
|
33
|
+
environment: string;
|
|
34
|
+
buildOutput?: string;
|
|
35
|
+
entityNames: string[];
|
|
36
|
+
entities: Map<string, {
|
|
37
|
+
entityType: string;
|
|
38
|
+
props: Record<string, unknown>;
|
|
39
|
+
}>;
|
|
40
|
+
owned?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** The uid a declared dashboard or datasource has in Grafana: the one the build gives it. */
|
|
43
|
+
export declare function declaredUid(name: string, entityType: string, props: Record<string, unknown>): string | undefined;
|
|
44
|
+
/** What `unsupported-kind` says about a provider. */
|
|
45
|
+
export declare const PROVIDER_NOT_OBSERVABLE = "a dashboard provider is a setting in Grafana's provisioning file, which Grafana serves no API for; its dashboards are observed instead";
|
|
46
|
+
/** What `unsupported-kind` says about a panel, row, query or variable that no declared dashboard holds. */
|
|
47
|
+
export declare const ORPHAN_PART = "panels, rows, queries and variables exist in Grafana only inside a dashboard, and no declared dashboard holds this one";
|
|
48
|
+
/** Observe every declared grafana entity against the environment's Grafana. */
|
|
49
|
+
export declare function describeResources(options: GrafanaObserveOptions): Promise<DescribeResourcesResult>;
|
|
50
|
+
//# sourceMappingURL=describe-resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-resources.d.ts","sourceRoot":"","sources":["../src/describe-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAGL,KAAK,uBAAuB,EAG7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAuC,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAYnF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,CAMhH;AAED,qDAAqD;AACrD,eAAO,MAAM,uBAAuB,2IACsG,CAAC;AAE3I,2GAA2G;AAC3G,eAAO,MAAM,WAAW,2HACkG,CAAC;AAiK3H,+EAA+E;AAC/E,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAQxG"}
|
package/dist/detect.d.ts
CHANGED
|
@@ -5,16 +5,45 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** Dashboard JSON: a `panels` array plus a `schemaVersion` or a `templating` block. */
|
|
7
7
|
export declare function looksLikeDashboard(data: unknown): data is Record<string, unknown>;
|
|
8
|
-
/** A
|
|
8
|
+
/** A dashboard saved before Grafana 5.0: panels inside a top-level `rows` list. */
|
|
9
|
+
export declare function looksLikeLegacyRowsDashboard(data: unknown): data is Record<string, unknown>;
|
|
10
|
+
/** A dashboard as the `dashboard.grafana.app` API serves it: `apiVersion`, `kind: Dashboard` and a `spec`. */
|
|
11
|
+
export declare function looksLikeDashboardResource(data: unknown): data is {
|
|
12
|
+
apiVersion: string;
|
|
13
|
+
kind: "Dashboard";
|
|
14
|
+
spec: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
/** A v2 dashboard: a `dashboard.grafana.app/v2*` resource, or a bare v2 spec (`elements` and `layout`). */
|
|
17
|
+
export declare function looksLikeV2Dashboard(data: unknown): boolean;
|
|
18
|
+
/** What `GET /api/dashboards/uid/<uid>` returns: `{ dashboard, meta }`. */
|
|
19
|
+
export declare function looksLikeDashboardApiResponse(data: unknown): data is {
|
|
20
|
+
dashboard: Record<string, unknown>;
|
|
21
|
+
meta: unknown;
|
|
22
|
+
};
|
|
23
|
+
/** A datasource provisioning file: `apiVersion` and a `datasources` or `deleteDatasources` list. */
|
|
9
24
|
export declare function looksLikeDatasourceProvisioning(data: unknown): data is {
|
|
10
25
|
apiVersion: unknown;
|
|
11
|
-
datasources
|
|
26
|
+
datasources?: unknown[];
|
|
27
|
+
deleteDatasources?: unknown[];
|
|
28
|
+
prune?: unknown;
|
|
12
29
|
};
|
|
13
30
|
/** A dashboard provisioning file: `apiVersion` and a `providers` list. */
|
|
14
31
|
export declare function looksLikeDashboardProvisioning(data: unknown): data is {
|
|
15
32
|
apiVersion: unknown;
|
|
16
33
|
providers: unknown[];
|
|
17
34
|
};
|
|
18
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* An alerting provisioning file (`provisioning/alerting/*.yaml`, or what
|
|
37
|
+
* `/api/v1/provisioning/*\/export` writes): at least one of the alerting
|
|
38
|
+
* lists at the top level and nothing but those and `apiVersion`. A `groups`
|
|
39
|
+
* list must hold Grafana rule groups, so a Prometheus rule file (`groups:`
|
|
40
|
+
* of `name` and `rules` with `expr`) is not mistaken for one.
|
|
41
|
+
*/
|
|
42
|
+
export declare function looksLikeAlertingProvisioning(data: unknown): data is Record<string, unknown>;
|
|
43
|
+
/**
|
|
44
|
+
* Template detection for `chant import` and friends: dashboard JSON in any
|
|
45
|
+
* of the shapes above (v2 included, #2947), or a datasource, dashboard or
|
|
46
|
+
* alerting provisioning file.
|
|
47
|
+
*/
|
|
19
48
|
export declare function detectTemplate(data: unknown): boolean;
|
|
20
49
|
//# sourceMappingURL=detect.d.ts.map
|
package/dist/detect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],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E,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,EAAE,CAAA;CAAE,CAEnH;AAuBD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAO5F;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAWrD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live export for grafana (#2946): `chant import --from <env>` writes the
|
|
3
|
+
* environment's dashboards and datasources as chant TypeScript.
|
|
4
|
+
*
|
|
5
|
+
* All I/O is here; the mapping is pure in ./import/live-export.ts, and the
|
|
6
|
+
* IR it builds is the importer's own (#2945), so a dashboard exported from
|
|
7
|
+
* Grafana and the same dashboard's JSON given to `chant import` generate the
|
|
8
|
+
* same source through the same `GrafanaGenerator`.
|
|
9
|
+
*
|
|
10
|
+
* - Every dashboard in the organisation is listed over the API the thin
|
|
11
|
+
* read uses (`/apis/dashboard.grafana.app`, or `/api/search` plus
|
|
12
|
+
* `/api/dashboards/uid` on Grafana 11). A dashboard stored as v2 is read at
|
|
13
|
+
* v2 and exported through its classic form, with a warning for each thing
|
|
14
|
+
* the classic form cannot hold (#2947).
|
|
15
|
+
* - Every datasource is read by uid, for `secureJsonFields`; secrets come
|
|
16
|
+
* back as key names only (see `datasourceProps`).
|
|
17
|
+
* - `selector.type` is `Grafana::Dashboard` or `Grafana::Datasource`;
|
|
18
|
+
* `selector.name` is a uid.
|
|
19
|
+
* - `owned` keeps only dashboards that are chant's (./ownership.ts), and
|
|
20
|
+
* leaves datasources out, since their ownership cannot be read. There is no
|
|
21
|
+
* project here to name its providers, so a file-provisioned dashboard is
|
|
22
|
+
* chant's when its provider is the default one, `chant`.
|
|
23
|
+
* - `verbatim` keeps datasource keys at the API's "not set" values. A
|
|
24
|
+
* dashboard is always planned by the importer, which leaves out keys at
|
|
25
|
+
* Grafana's defaults either way.
|
|
26
|
+
*/
|
|
27
|
+
import type { ExportedTemplate, ResourceSelector } from "@intentius/chant/lexicon";
|
|
28
|
+
import { type BindOptions } from "./api/bind.js";
|
|
29
|
+
export interface GrafanaExportOptions extends Omit<BindOptions, "environment"> {
|
|
30
|
+
environment: string;
|
|
31
|
+
stack?: string;
|
|
32
|
+
region?: string;
|
|
33
|
+
selector?: ResourceSelector;
|
|
34
|
+
owned?: boolean;
|
|
35
|
+
verbatim?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function exportResources(options: GrafanaExportOptions): Promise<ExportedTemplate>;
|
|
38
|
+
//# sourceMappingURL=export-resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-resources.d.ts","sourceRoot":"","sources":["../src/export-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAU3D,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoC9F"}
|
package/dist/folder.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Folder`: a Grafana folder with a stable uid, nested with `parent`.
|
|
3
|
+
*
|
|
4
|
+
* A dashboard names its folder either as a path string
|
|
5
|
+
* (`folder: "Platform/Kubernetes"`) or as a `Folder`. Both give the same
|
|
6
|
+
* folders: one per level, each with the uid `folderUidFor` makes from its
|
|
7
|
+
* path unless a `Folder` sets one. A `Folder` is needed only to pin a uid
|
|
8
|
+
* (for links, alert rules, permissions set elsewhere) or to declare a folder
|
|
9
|
+
* that holds no dashboard yet.
|
|
10
|
+
*
|
|
11
|
+
* How each delivery carries it:
|
|
12
|
+
*
|
|
13
|
+
* - File provisioning writes the dashboard under `dashboards/<level>/...`,
|
|
14
|
+
* and a provider with `foldersFromFilesStructure` makes one folder per
|
|
15
|
+
* level (nested on Grafana 13.1 and later; GRAF109 says what earlier
|
|
16
|
+
* versions do). Grafana finds each level's folder by title under its
|
|
17
|
+
* parent and creates it when missing, with a uid of its own: file
|
|
18
|
+
* provisioning has no field for a nested folder's uid. A folder the API
|
|
19
|
+
* applier made first keeps the uid it was given. A `DashboardProvider`
|
|
20
|
+
* whose `folder` is a root-level `Folder` writes its `folderUid`.
|
|
21
|
+
* - The API applier (./api/apply.ts) creates every folder with its uid and
|
|
22
|
+
* parent, parents first.
|
|
23
|
+
* - Observation reads a dashboard's folder back as its path, and a `Folder`
|
|
24
|
+
* by its uid.
|
|
25
|
+
*
|
|
26
|
+
* The rules for turning folders into uids and parents are in one place,
|
|
27
|
+
* `resolveFolders` in ./api/folders.ts, which the build, the applier and
|
|
28
|
+
* observation all call.
|
|
29
|
+
*/
|
|
30
|
+
import type { Declarable } from "@intentius/chant/declarable";
|
|
31
|
+
export interface FolderProps {
|
|
32
|
+
/** The title Grafana shows. A single level: nest with `parent`, not with `/`. */
|
|
33
|
+
title: string;
|
|
34
|
+
/**
|
|
35
|
+
* Stable id: letters, digits, `-` and `_`, at most 40 characters, and not
|
|
36
|
+
* `general`, which Grafana keeps for its root. Defaults to the folder's
|
|
37
|
+
* path as a uid (`Platform/Kubernetes` becomes `platform-kubernetes`), the
|
|
38
|
+
* same uid a dashboard's `folder: "Platform/Kubernetes"` gives it.
|
|
39
|
+
*/
|
|
40
|
+
uid?: string;
|
|
41
|
+
/** The folder this one is in. Leave it out for a folder at the root. */
|
|
42
|
+
parent?: FolderEntity;
|
|
43
|
+
}
|
|
44
|
+
export interface FolderEntity extends Declarable {
|
|
45
|
+
readonly props: FolderProps;
|
|
46
|
+
/** The uid Grafana gives the folder: its own, else one made from its path. */
|
|
47
|
+
readonly uid: string;
|
|
48
|
+
/** Its titles from the root, joined with `/`: the directory the build writes it to. */
|
|
49
|
+
readonly path: string;
|
|
50
|
+
}
|
|
51
|
+
export declare const FOLDER_TYPE = "Grafana::Folder";
|
|
52
|
+
/**
|
|
53
|
+
* The levels of a folder path, as the build writes them to directories:
|
|
54
|
+
* split on `/`, a backslash made `-`, leading dots and surrounding blanks
|
|
55
|
+
* dropped, so no level names a directory outside `dashboards/`. Empty levels
|
|
56
|
+
* are dropped; no levels at all is the General folder.
|
|
57
|
+
*/
|
|
58
|
+
export declare function folderLevels(path: string): string[];
|
|
59
|
+
/** The uid chant gives a folder it only knows by path. Stable, so a second apply finds the folder the first one made. */
|
|
60
|
+
export declare function folderUidFor(path: string): string;
|
|
61
|
+
/** A Grafana folder. */
|
|
62
|
+
export declare const Folder: new (props: FolderProps) => FolderEntity;
|
|
63
|
+
export declare function isFolderEntity(value: unknown): value is FolderEntity;
|
|
64
|
+
/** A folder's uid from its props, as observation sees them (the props of a `Folder`, parents included). */
|
|
65
|
+
export declare function folderUidOf(props: Record<string, unknown>): string | undefined;
|
|
66
|
+
/** A folder's path from its props, walking `parent`. */
|
|
67
|
+
export declare function folderPathOf(props: Record<string, unknown>): string | undefined;
|
|
68
|
+
//# sourceMappingURL=folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../src/folder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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isioning/*\/export` writes (the same format at v12.4.11
|
|
6
|
+
* and v13.2.2): rule groups, contact points, notification policies, mute
|
|
7
|
+
* timings and templates, in one file or split across several.
|
|
8
|
+
*
|
|
9
|
+
* - A rule group becomes an `AlertRuleGroup`, each rule an `AlertRule`,
|
|
10
|
+
* each entry of a rule's `data` a declaration of its own: a server-side
|
|
11
|
+
* expression as its typed class (`ReduceExpression`, `ThresholdExpression`,
|
|
12
|
+
* ...), and a datasource query as an `AlertQuery` holding its model as it
|
|
13
|
+
* is, so nothing a plugin stores is lost.
|
|
14
|
+
* - A datasource uid a query names becomes an `ExternalDatasource` when the
|
|
15
|
+
* file says its plugin type (`model.datasource.type`), so the checks can
|
|
16
|
+
* see it (GRAF108 parses Prometheus queries). When the type has to be
|
|
17
|
+
* inferred from the model, the import says so; when it cannot be told,
|
|
18
|
+
* the query keeps the bare uid and the import says that too.
|
|
19
|
+
* - A contact point, policy, mute timing or template becomes its class;
|
|
20
|
+
* a receiver or timing named in the same file is referenced by variable.
|
|
21
|
+
* - `deleteRules`, `deleteContactPoints`, `resetPolicies`, `deleteMuteTimes`
|
|
22
|
+
* and `deleteTemplates` are not carried, with a warning.
|
|
23
|
+
*
|
|
24
|
+
* Grafana's editor writes keys into expression models that the expression
|
|
25
|
+
* does not read (a `conditions` block on reduce and math, `operator`,
|
|
26
|
+
* `query`, `reducer` and `type` in a threshold's conditions, `type` and
|
|
27
|
+
* `reducer.params` in classic conditions). They are left out as edits without a warning:
|
|
28
|
+
* Grafana evaluates the rule the same without them.
|
|
29
|
+
*/
|
|
30
|
+
import { type ImportEdit } from "./edits.js";
|
|
31
|
+
import { type Plan } from "./model.js";
|
|
32
|
+
type Json = Record<string, unknown>;
|
|
33
|
+
/** Plan an alerting provisioning file. `edits` applied to the file give what the rebuilt file should equal (see `normalizeAlerting`). */
|
|
34
|
+
export declare function planAlertingProvisioning(doc: Json): {
|
|
35
|
+
plan: Plan;
|
|
36
|
+
edits: ImportEdit[];
|
|
37
|
+
warnings: string[];
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=alerting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerting.d.ts","sourceRoot":"","sources":["../../src/import/alerting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAA2C,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AAO7E,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAucpC,yIAAyI;AACzI,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,IAAI,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAI3G"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the importer did to a dashboard on the way to TypeScript, as edits
|
|
3
|
+
* to its JSON.
|
|
4
|
+
*
|
|
5
|
+
* Every key the importer leaves out, and every value it writes in another
|
|
6
|
+
* form, is one edit, and every edit that changes what Grafana does comes
|
|
7
|
+
* with an import warning. The round-trip test applies the edits to the
|
|
8
|
+
* source dashboard and expects the rebuilt dashboard to equal the result
|
|
9
|
+
* (after `normalizeDashboard`), which is how it checks that nothing is
|
|
10
|
+
* dropped without a warning.
|
|
11
|
+
*/
|
|
12
|
+
type Json = Record<string, unknown>;
|
|
13
|
+
export type ImportEdit =
|
|
14
|
+
/** The value at `path` (a JSON pointer) is not carried. */
|
|
15
|
+
{
|
|
16
|
+
readonly op: "remove";
|
|
17
|
+
readonly path: string;
|
|
18
|
+
}
|
|
19
|
+
/** The value at `path` is written as `value`. */
|
|
20
|
+
| {
|
|
21
|
+
readonly op: "replace";
|
|
22
|
+
readonly path: string;
|
|
23
|
+
readonly value: unknown;
|
|
24
|
+
}
|
|
25
|
+
/** Every string in the dashboard has `from` replaced by `to` (an `__inputs` constant filled in). */
|
|
26
|
+
| {
|
|
27
|
+
readonly op: "substitute";
|
|
28
|
+
readonly from: string;
|
|
29
|
+
readonly to: string;
|
|
30
|
+
}
|
|
31
|
+
/** `value` is added at the front of `templating.list` (an `__inputs` datasource as a variable). */
|
|
32
|
+
| {
|
|
33
|
+
readonly op: "prependVariable";
|
|
34
|
+
readonly value: Json;
|
|
35
|
+
};
|
|
36
|
+
/** `/a/b/0` as its unescaped segments. */
|
|
37
|
+
export declare function pointerSegments(path: string): string[];
|
|
38
|
+
/** A JSON pointer from segments. */
|
|
39
|
+
export declare function pointer(...segments: Array<string | number>): string;
|
|
40
|
+
/**
|
|
41
|
+
* The dashboard with the edits applied: substitutions first, then
|
|
42
|
+
* replacements and removals (all by pointers into the original), then the
|
|
43
|
+
* prepended variables.
|
|
44
|
+
*/
|
|
45
|
+
export declare function applyEdits(dashboard: Json, edits: readonly ImportEdit[]): Json;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=edits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edits.d.ts","sourceRoot":"","sources":["../../src/import/edits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC,MAAM,MAAM,UAAU;AACpB,2DAA2D;AACzD;IAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AAClD,iDAAiD;GAC/C;IAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE;AAC5E,oGAAoG;GAClG;IAAE,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE;AAC3E,mGAAmG;GACjG;IAAE,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC;AAE7D,0CAA0C;AAC1C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAMtD;AAED,oCAAoC;AACpC,wBAAgB,OAAO,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAEnE;AA+BD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,IAAI,CAoB9E"}
|