@intentius/chant-lexicon-grafana 0.97.0 → 0.99.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 +15 -5
- 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/api/apply.d.ts +156 -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 +61 -0
- package/dist/api/fake-grafana.d.ts.map +1 -0
- package/dist/api/folders.d.ts +110 -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 +30 -2
- 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/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 +7 -0
- 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 +16 -2
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/datasource-refs.d.ts +95 -0
- package/dist/datasource-refs.d.ts.map +1 -0
- package/dist/datasource.d.ts +29 -0
- 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 +42 -0
- package/dist/deep-observe.d.ts.map +1 -0
- package/dist/describe-resources.d.ts +49 -0
- package/dist/describe-resources.d.ts.map +1 -0
- package/dist/detect.d.ts +28 -1
- 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/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 +83 -0
- package/dist/import/mappings.d.ts.map +1 -0
- package/dist/import/model.d.ts +98 -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 +110 -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 +35 -0
- package/dist/import/testdata/fixtures.d.ts.map +1 -0
- package/dist/import/v2.d.ts +72 -0
- package/dist/import/v2.d.ts.map +1 -0
- package/dist/index.d.ts +26 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +18 -10
- 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/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/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 +135 -0
- package/dist/okf/index.md +36 -2
- 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/GRAF108.md +11 -0
- package/dist/okf/rules/GRAF109.md +15 -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/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/BarChartPanel.md +9 -0
- package/dist/okf/types/BarGaugePanel.md +9 -0
- package/dist/okf/types/CanvasPanel.md +9 -0
- package/dist/okf/types/ClassicConditionsExpression.md +9 -0
- package/dist/okf/types/ContactPoint.md +14 -0
- package/dist/okf/types/Dashboard.md +1 -0
- package/dist/okf/types/Datasource.md +3 -2
- package/dist/okf/types/ExternalDatasource.md +15 -0
- package/dist/okf/types/FlameGraphPanel.md +9 -0
- package/dist/okf/types/GeomapPanel.md +9 -0
- package/dist/okf/types/HistogramPanel.md +9 -0
- package/dist/okf/types/MathExpression.md +9 -0
- package/dist/okf/types/MuteTiming.md +13 -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/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/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 +75 -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 +67 -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.d.ts +9 -8
- 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/graf107.ts +1 -1
- package/dist/rules/graf108.ts +17 -0
- package/dist/rules/graf109.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 +15 -8
- package/dist/rules/literal-secret.ts +60 -6
- 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/canvas.gen.d.ts +152 -0
- package/dist/schema/canvas.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/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/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 +12 -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 +22 -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 +30 -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-provisioning.md +3 -3
- package/dist/skills/chant-grafana.md +12 -6
- 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 +13 -7
- package/dist/spec/schemas.d.ts.map +1 -1
- 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 +49 -9
- package/dist/validate-output.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/variables.d.ts +7 -2
- 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/api/apply.test.ts +238 -0
- package/src/api/apply.ts +384 -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 +186 -0
- package/src/api/folders.ts +265 -0
- package/src/api/library-panels.ts +101 -0
- package/src/build.test.ts +210 -5
- package/src/build.ts +180 -43
- package/src/catalog.ts +86 -2
- package/src/codegen/docs.ts +42 -9
- 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 +11 -0
- 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 +16 -2
- package/src/datasource-refs.test.ts +56 -0
- package/src/datasource-refs.ts +189 -0
- package/src/datasource.ts +52 -0
- package/src/deep-observe-hooks.ts +252 -0
- package/src/deep-observe.test.ts +265 -0
- package/src/deep-observe.ts +164 -0
- package/src/describe-resources.test.ts +255 -0
- package/src/describe-resources.ts +209 -0
- package/src/detect.ts +79 -2
- package/src/export-resources.test.ts +129 -0
- package/src/export-resources.ts +84 -0
- package/src/generated/lexicon-grafana.json +135 -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 +118 -0
- package/src/import/generator.test.ts +210 -0
- package/src/import/generator.ts +462 -0
- package/src/import/live-export.ts +264 -0
- package/src/import/mappings.ts +264 -0
- package/src/import/model.ts +110 -0
- package/src/import/normalize-alerting.ts +101 -0
- package/src/import/normalize.test.ts +117 -0
- package/src/import/normalize.ts +364 -0
- package/src/import/parser.test.ts +440 -0
- package/src/import/parser.ts +1236 -0
- package/src/import/report.ts +62 -0
- package/src/import/roundtrip.test.ts +468 -0
- package/src/import/testdata/fixtures.ts +129 -0
- package/src/import/v2.test.ts +292 -0
- package/src/import/v2.ts +803 -0
- package/src/import.e2e.test.ts +31 -84
- package/src/import.test.ts +9 -3
- package/src/index.ts +190 -5
- package/src/k8s.test.ts +98 -0
- package/src/k8s.ts +197 -0
- package/src/lint/audit-catalog.ts +60 -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/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/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 +15 -8
- package/src/lint/post-synth/index.ts +14 -0
- package/src/lint/post-synth/post-synth.test.ts +235 -11
- package/src/lint/rules/literal-secret.ts +60 -6
- package/src/lint/rules/rules.test.ts +27 -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 +175 -0
- package/src/op/activities/grafana-apply.test.ts +229 -0
- package/src/op/activities/grafana-apply.ts +171 -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 +103 -0
- package/src/panel-options.ts +66 -0
- package/src/panels.test.ts +51 -0
- package/src/panels.ts +148 -10
- package/src/pin.ts +57 -6
- package/src/plugin.test.ts +5 -2
- package/src/plugin.ts +66 -0
- package/src/promql-check.test.ts +108 -0
- package/src/promql-check.ts +189 -0
- package/src/query.ts +13 -8
- package/src/schema/barchart.gen.ts +221 -0
- package/src/schema/bargauge.gen.ts +111 -0
- package/src/schema/canvas.gen.ts +176 -0
- package/src/schema/dashboard.gen.ts +206 -22
- 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/heatmap.gen.ts +2 -1
- package/src/schema/histogram.gen.ts +151 -0
- package/src/schema/index.ts +12 -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 +27 -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 +141 -50
- 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 +17 -0
- package/src/skills/chant-grafana-alerting.md +49 -0
- package/src/skills/chant-grafana-provisioning.md +3 -3
- package/src/skills/chant-grafana.md +12 -6
- 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 +84 -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/barchart.jsonschema.json +419 -0
- package/src/spec/schemas/bargauge.jsonschema.json +224 -0
- package/src/spec/schemas/canvas.jsonschema.json +356 -0
- package/src/spec/schemas/dashboardv2.jsonschema.json +3387 -0
- package/src/spec/schemas/expr.jsonschema.json +987 -0
- package/src/spec/schemas/geomap.jsonschema.json +220 -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.ts +22 -10
- 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 +428 -0
- package/src/validate-output.ts +332 -101
- package/src/validate.ts +14 -0
- package/src/variables.ts +7 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: ClassicConditionsExpression
|
|
4
|
+
description: grafana resource type Grafana::Expression::classic_conditions
|
|
5
|
+
name: ClassicConditionsExpression
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Expression::classic_conditions
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Expression::classic_conditions`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: ContactPoint
|
|
4
|
+
description: grafana resource type Grafana::ContactPoint
|
|
5
|
+
name: ContactPoint
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::ContactPoint
|
|
8
|
+
---
|
|
9
|
+
`Grafana::ContactPoint`, a resource type of the grafana lexicon.
|
|
10
|
+
|
|
11
|
+
## Governed by
|
|
12
|
+
|
|
13
|
+
- [GRAF002](/rules/GRAF002.md): a datasource or contact point secret written as a literal.
|
|
14
|
+
- [GRAF113](/rules/GRAF113.md): Alerting routes to a contact point or mute timing the build does not declare, or a policy matcher does not parse
|
|
@@ -12,3 +12,4 @@ resource_type: Grafana::Dashboard
|
|
|
12
12
|
|
|
13
13
|
- [GRAF001](/rules/GRAF001.md): a uid Grafana rejects, or a variable name queries cannot reference.
|
|
14
14
|
- [GRAF104](/rules/GRAF104.md): Two dashboards, datasources, panels, variables or queries share an id
|
|
15
|
+
- [GRAF109](/rules/GRAF109.md): Dashboard provisioning puts a dashboard somewhere other than its declared folder, or loads it twice
|
|
@@ -11,6 +11,7 @@ resource_type: Grafana::Datasource
|
|
|
11
11
|
## Governed by
|
|
12
12
|
|
|
13
13
|
- [GRAF001](/rules/GRAF001.md): a uid Grafana rejects, or a variable name queries cannot reference.
|
|
14
|
-
- [GRAF002](/rules/GRAF002.md): a datasource secret written as a literal.
|
|
15
|
-
- [GRAF101](/rules/GRAF101.md): A panel, query or variable uses a datasource no Datasource in the build declares
|
|
14
|
+
- [GRAF002](/rules/GRAF002.md): a datasource or contact point secret written as a literal.
|
|
15
|
+
- [GRAF101](/rules/GRAF101.md): A panel, query or variable uses a datasource no Datasource or ExternalDatasource in the build declares
|
|
16
16
|
- [GRAF102](/rules/GRAF102.md): A query is sent to a datasource of another plugin type
|
|
17
|
+
- [GRAF112](/rules/GRAF112.md): An alert rule queries a datasource the build does not declare, or of another type
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: ExternalDatasource
|
|
4
|
+
description: grafana resource type Grafana::ExternalDatasource
|
|
5
|
+
name: ExternalDatasource
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::ExternalDatasource
|
|
8
|
+
---
|
|
9
|
+
`Grafana::ExternalDatasource`, a resource type of the grafana lexicon.
|
|
10
|
+
|
|
11
|
+
## Governed by
|
|
12
|
+
|
|
13
|
+
- [GRAF101](/rules/GRAF101.md): A panel, query or variable uses a datasource no Datasource or ExternalDatasource in the build declares
|
|
14
|
+
- [GRAF102](/rules/GRAF102.md): A query is sent to a datasource of another plugin type
|
|
15
|
+
- [GRAF112](/rules/GRAF112.md): An alert rule queries a datasource the build does not declare, or of another type
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: FlameGraphPanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::flamegraph
|
|
5
|
+
name: FlameGraphPanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::flamegraph
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::flamegraph`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: HistogramPanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::histogram
|
|
5
|
+
name: HistogramPanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::histogram
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::histogram`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: MathExpression
|
|
4
|
+
description: grafana resource type Grafana::Expression::math
|
|
5
|
+
name: MathExpression
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Expression::math
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Expression::math`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: MuteTiming
|
|
4
|
+
description: grafana resource type Grafana::MuteTiming
|
|
5
|
+
name: MuteTiming
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::MuteTiming
|
|
8
|
+
---
|
|
9
|
+
`Grafana::MuteTiming`, a resource type of the grafana lexicon.
|
|
10
|
+
|
|
11
|
+
## Governed by
|
|
12
|
+
|
|
13
|
+
- [GRAF113](/rules/GRAF113.md): Alerting routes to a contact point or mute timing the build does not declare, or a policy matcher does not parse
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: NodeGraphPanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::nodeGraph
|
|
5
|
+
name: NodeGraphPanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::nodeGraph
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::nodeGraph`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: NotificationPolicy
|
|
4
|
+
description: grafana resource type Grafana::NotificationPolicy
|
|
5
|
+
name: NotificationPolicy
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::NotificationPolicy
|
|
8
|
+
---
|
|
9
|
+
`Grafana::NotificationPolicy`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: NotificationTemplate
|
|
4
|
+
description: grafana resource type Grafana::NotificationTemplate
|
|
5
|
+
name: NotificationTemplate
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::NotificationTemplate
|
|
8
|
+
---
|
|
9
|
+
`Grafana::NotificationTemplate`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: PieChartPanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::piechart
|
|
5
|
+
name: PieChartPanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::piechart
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::piechart`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: ReduceExpression
|
|
4
|
+
description: grafana resource type Grafana::Expression::reduce
|
|
5
|
+
name: ReduceExpression
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Expression::reduce
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Expression::reduce`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: ResampleExpression
|
|
4
|
+
description: grafana resource type Grafana::Expression::resample
|
|
5
|
+
name: ResampleExpression
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Expression::resample
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Expression::resample`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: SqlExpression
|
|
4
|
+
description: grafana resource type Grafana::Expression::sql
|
|
5
|
+
name: SqlExpression
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Expression::sql
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Expression::sql`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: StateTimelinePanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::state-timeline
|
|
5
|
+
name: StateTimelinePanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::state-timeline
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::state-timeline`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: StatusHistoryPanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::status-history
|
|
5
|
+
name: StatusHistoryPanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::status-history
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::status-history`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: ThresholdExpression
|
|
4
|
+
description: grafana resource type Grafana::Expression::threshold
|
|
5
|
+
name: ThresholdExpression
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Expression::threshold
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Expression::threshold`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: XYChartPanel
|
|
4
|
+
description: grafana resource type Grafana::Panel::xychart
|
|
5
|
+
name: XYChartPanel
|
|
6
|
+
lexicon: grafana
|
|
7
|
+
resource_type: Grafana::Panel::xychart
|
|
8
|
+
---
|
|
9
|
+
`Grafana::Panel::xychart`, a resource type of the grafana lexicon.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `grafanaApply`, the Op activity for the Grafana API applier (#2948), and
|
|
3
|
+
* `toApplyResult`, its projection onto core's apply envelope (#1446).
|
|
4
|
+
*
|
|
5
|
+
* It reads a build's output (the index the serializer writes as its primary
|
|
6
|
+
* output, and the dashboard files beside it), binds the environment's
|
|
7
|
+
* Grafana the way observe and export do (`grafana.profiles.<env>`, else
|
|
8
|
+
* `GRAFANA_URL`; ../../api/bind.ts), and hands the plan to `applyGrafana`
|
|
9
|
+
* (../../api/apply.ts), which holds the API decisions.
|
|
10
|
+
*
|
|
11
|
+
* The ownership marker is the project's: `ownership.stack` and
|
|
12
|
+
* `ownership.env` from `chant.config.ts`, or `stack`/`ownershipEnv` passed
|
|
13
|
+
* in. Without a stack the apply still runs, stamping only the managed-by
|
|
14
|
+
* label, and a prune declines (as `not-prunable`) rather than delete
|
|
15
|
+
* another stack's dashboards.
|
|
16
|
+
*/
|
|
17
|
+
import type { ChantConfig } from "@intentius/chant/config";
|
|
18
|
+
import type { OwnershipMarker } from "@intentius/chant/ownership";
|
|
19
|
+
import { type ApplyResult } from "@intentius/chant/apply";
|
|
20
|
+
import type { GrafanaHttp } from "../../api/client.js";
|
|
21
|
+
import { type BuiltDashboardInput, type GrafanaApplyOutcome } from "../../api/apply.js";
|
|
22
|
+
export type { GrafanaApplyOutcome } from "../../api/apply.js";
|
|
23
|
+
export interface GrafanaApplyArgs {
|
|
24
|
+
/**
|
|
25
|
+
* The build's primary output: the index the grafana serializer writes
|
|
26
|
+
* (`chant build -o dist/grafana.json`). The dashboard files it lists are
|
|
27
|
+
* read from the same directory. A combined multi-lexicon output works too;
|
|
28
|
+
* its `grafana` key is used.
|
|
29
|
+
*/
|
|
30
|
+
indexPath: string;
|
|
31
|
+
/** The chant environment, which selects `grafana.profiles.<environment>`. */
|
|
32
|
+
environment?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Delete this project's dashboards and folders that the build no longer
|
|
35
|
+
* declares: only those carrying its ownership marker, stack and env.
|
|
36
|
+
* Destructive, so off by default.
|
|
37
|
+
*/
|
|
38
|
+
prune?: boolean;
|
|
39
|
+
/** Ownership stack. Default: `ownership.stack` in `chant.config.ts`. */
|
|
40
|
+
stack?: string;
|
|
41
|
+
/** Ownership env. Default: `ownership.env` in `chant.config.ts` (a literal; a `{ param }` reference needs this). */
|
|
42
|
+
ownershipEnv?: string;
|
|
43
|
+
/** Project directory for `chant.config.ts`. Default: the working directory. */
|
|
44
|
+
cwd?: string;
|
|
45
|
+
}
|
|
46
|
+
/** What a test (or an embedding caller) may inject instead of the project's config, the process env and `fetch`. */
|
|
47
|
+
export interface GrafanaApplyDeps {
|
|
48
|
+
http?: GrafanaHttp;
|
|
49
|
+
config?: Pick<ChantConfig, "grafana" | "ownership">;
|
|
50
|
+
env?: Record<string, string | undefined>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The dashboards a build wrote, read from its index and the files beside
|
|
54
|
+
* it. Pure but for the file reads.
|
|
55
|
+
*/
|
|
56
|
+
export declare function readBuiltDashboards(indexPath: string, read?: (path: string) => string): BuiltDashboardInput[];
|
|
57
|
+
/** The marker to stamp and prune by: the arguments, else the project's `ownership` config. */
|
|
58
|
+
export declare function resolveMarker(args: Pick<GrafanaApplyArgs, "stack" | "ownershipEnv">, config: Pick<ChantConfig, "ownership"> | undefined): OwnershipMarker | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Apply a grafana build to the environment's Grafana over its HTTP API.
|
|
61
|
+
* Dashboards and folders get chant's ownership labels; with `prune`, this
|
|
62
|
+
* project's dashboards and folders the build no longer has are deleted.
|
|
63
|
+
* A target that cannot be bound returns every resource as not attempted,
|
|
64
|
+
* with the binding's reason.
|
|
65
|
+
*/
|
|
66
|
+
export declare function grafanaApply(args: GrafanaApplyArgs, signal?: AbortSignal, deps?: GrafanaApplyDeps): Promise<GrafanaApplyOutcome>;
|
|
67
|
+
/**
|
|
68
|
+
* Project a grafana apply outcome onto core's apply envelope. The outcome
|
|
69
|
+
* keeps what the envelope has no room for (the request path, the API
|
|
70
|
+
* version, the binding's source); a kind the prune could not consider has no
|
|
71
|
+
* single resource name, so it is reported as `<kind>/*`, `not-prunable`,
|
|
72
|
+
* as the gcp applier does.
|
|
73
|
+
*/
|
|
74
|
+
export declare function toApplyResult(outcome: GrafanaApplyOutcome): ApplyResult;
|
|
75
|
+
//# sourceMappingURL=grafana-apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grafana-apply.d.ts","sourceRoot":"","sources":["../../../src/op/activities/grafana-apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAIL,KAAK,WAAW,EAEjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAkE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAErJ,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oHAAoH;IACpH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,oHAAoH;AACpH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,WAAW,CAAC,CAAC;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AAQD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAuC,GAAG,mBAAmB,EAAE,CAW7I;AAWD,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,cAAc,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,SAAS,GAAG,eAAe,GAAG,SAAS,CAUrK;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqC1I;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,CAOvE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grafana Op activities, resolved by the core activity registry when a
|
|
3
|
+
* project's `chant.config.ts` lists the `grafana` lexicon. Contributes the
|
|
4
|
+
* API applier (`grafanaApply`, #2948) and its envelope projection
|
|
5
|
+
* (`toApplyResult`), which core's apply activity looks up by name.
|
|
6
|
+
*/
|
|
7
|
+
export { grafanaApply, toApplyResult, readBuiltDashboards, resolveMarker } from "./grafana-apply.js";
|
|
8
|
+
export type { GrafanaApplyArgs, GrafanaApplyDeps, GrafanaApplyOutcome } from "./grafana-apply.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClG,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed step builder for this lexicon's activity (chant #1288 Stage 2),
|
|
3
|
+
* beside its `*Args` interface for the reason `lexicons/k8s/src/op/builders.ts`
|
|
4
|
+
* gives: core cannot import a lexicon's types. `opts` is
|
|
5
|
+
* {@link GrafanaApplyArgs} itself (via `Omit`/`WithStepRefs`), never
|
|
6
|
+
* restated.
|
|
7
|
+
*/
|
|
8
|
+
import { type ActivityStep, type NamedActivityStep, type WithStepRefs } from "@intentius/chant/op";
|
|
9
|
+
import type { GrafanaApplyArgs } from "./activities/grafana-apply.js";
|
|
10
|
+
/** Extra opts the builder accepts alongside the activity's own fields. */
|
|
11
|
+
type StepOpts = {
|
|
12
|
+
profile?: ActivityStep["profile"];
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Apply a grafana build to the environment's Grafana over its HTTP API
|
|
17
|
+
* (#2948): folders, library panels and dashboards, stamped with chant's
|
|
18
|
+
* ownership labels, and with `prune`, this project's orphans deleted.
|
|
19
|
+
* `opts` is {@link GrafanaApplyArgs} minus the positional `indexPath`.
|
|
20
|
+
* Defaults to the `longInfra` profile, as the other API appliers do.
|
|
21
|
+
*/
|
|
22
|
+
export declare const grafanaApply: (indexPath: string, opts?: WithStepRefs<Omit<GrafanaApplyArgs, "indexPath">> & StepOpts) => NamedActivityStep;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,0EAA0E;AAC1E,KAAK,QAAQ,GAAG;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GACvB,WAAW,MAAM,EACjB,OAAO,YAAY,CAAC,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,GAAG,QAAQ,KAClE,iBAGF,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whose a live dashboard is (#2946).
|
|
3
|
+
*
|
|
4
|
+
* `serializer.ts` used to say Grafana had no metadata channel. It has two,
|
|
5
|
+
* both on the `dashboard.grafana.app` resource and neither in the dashboard
|
|
6
|
+
* JSON:
|
|
7
|
+
*
|
|
8
|
+
* - **`metadata.labels`**, which Grafana keeps as written for a dashboard
|
|
9
|
+
* created or updated through `/apis`. chant's marker there is the shared
|
|
10
|
+
* Kubernetes label convention, `LABEL_OWNERSHIP_KEYS`
|
|
11
|
+
* (`app.kubernetes.io/managed-by: chant` plus the stack and env labels).
|
|
12
|
+
* The API applier (#2948) stamps it with {@link grafanaOwnershipLabels};
|
|
13
|
+
* this reads it back, stack and env included.
|
|
14
|
+
* - **`metadata.annotations`**, which Grafana writes itself for a
|
|
15
|
+
* file-provisioned dashboard: `grafana.app/managedBy:
|
|
16
|
+
* classic-file-provisioning` and `grafana.app/managerId: <provider name>`.
|
|
17
|
+
* The provider name is the one chant writes into
|
|
18
|
+
* `provisioning/dashboards/chant.yaml` (`chant` unless a
|
|
19
|
+
* `DashboardProvider` names another), so a dashboard whose manager is one
|
|
20
|
+
* of the project's providers is chant's. That channel carries no stack or
|
|
21
|
+
* env, so it gives a verdict and never a marker.
|
|
22
|
+
*
|
|
23
|
+
* Anything else a read can see (a dashboard saved in the UI, one another
|
|
24
|
+
* provider or tool manages) is `foreign`.
|
|
25
|
+
*
|
|
26
|
+
* Two reads have no channel at all, and say `unknown` rather than guess:
|
|
27
|
+
* the legacy `/api/dashboards/uid` read Grafana 11 is observed through, and
|
|
28
|
+
* every datasource read (`/api/datasources` returns no labels, and the
|
|
29
|
+
* `readOnly` flag says a datasource is provisioned, not by whom).
|
|
30
|
+
*/
|
|
31
|
+
import { type ChannelKeys, type OwnershipMarker } from "@intentius/chant/ownership";
|
|
32
|
+
import type { LiveDashboard } from "./api/dashboards.js";
|
|
33
|
+
/** The label keys chant's marker uses on a `dashboard.grafana.app` resource. */
|
|
34
|
+
export declare const GRAFANA_OWNERSHIP_KEYS: ChannelKeys;
|
|
35
|
+
export declare const MANAGED_BY_ANNOTATION = "grafana.app/managedBy";
|
|
36
|
+
export declare const MANAGER_ID_ANNOTATION = "grafana.app/managerId";
|
|
37
|
+
/** `grafana.app/managedBy` for a dashboard loaded by a file provider. */
|
|
38
|
+
export declare const FILE_PROVISIONING_MANAGER = "classic-file-provisioning";
|
|
39
|
+
/**
|
|
40
|
+
* The provider name the build writes when a project declares none. It is
|
|
41
|
+
* chant's managed-by value on purpose: it comes back from Grafana as the
|
|
42
|
+
* `grafana.app/managerId` of every dashboard the provider loads.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DEFAULT_PROVIDER_NAME = "chant";
|
|
45
|
+
export type OwnershipVerdict = "owned" | "foreign" | "unknown";
|
|
46
|
+
/** The labels the API applier (#2948) writes on a dashboard it creates, for this build's stack and env. */
|
|
47
|
+
export declare function grafanaOwnershipLabels(ownership: {
|
|
48
|
+
stack: string;
|
|
49
|
+
env?: string;
|
|
50
|
+
}): Record<string, string>;
|
|
51
|
+
/**
|
|
52
|
+
* The provider names that load this project's dashboards: every declared
|
|
53
|
+
* `DashboardProvider`, or the default one the build writes when there is
|
|
54
|
+
* none.
|
|
55
|
+
*/
|
|
56
|
+
export declare function chantProviderNames(entities: Iterable<{
|
|
57
|
+
entityType: string;
|
|
58
|
+
props: Record<string, unknown>;
|
|
59
|
+
}>): Set<string>;
|
|
60
|
+
/** Why a verdict is what it is, for an `owned: true` read to put in its `filtered` detail. */
|
|
61
|
+
export declare function ownershipGap(dashboard: LiveDashboard): string;
|
|
62
|
+
/** A dashboard's ownership verdict, and the stack/env marker when its labels carry one. */
|
|
63
|
+
export declare function dashboardOwnership(dashboard: LiveDashboard, providers: ReadonlySet<string>): {
|
|
64
|
+
ownership: OwnershipVerdict;
|
|
65
|
+
marker?: OwnershipMarker;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../src/ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,EAAE,WAAkC,CAAC;AAExE,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAC7D,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAC7D,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,UAA6B,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/D,2GAA2G;AAC3G,wBAAgB,sBAAsB,CAAC,SAAS,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEzG;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAO1H;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAI7D;AAED,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,GAC7B;IAAE,SAAS,EAAE,gBAAgB,CAAC;IAAC,MAAM,CAAC,EAAE,eAAe,CAAA;CAAE,CAW3D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-written option types for the built-in panels that have no schema.
|
|
3
|
+
*
|
|
4
|
+
* The alert list and flame graph panels define their options in TypeScript
|
|
5
|
+
* inside Grafana's frontend, with no CUE kind, so foundation-sdk publishes
|
|
6
|
+
* no JSON Schema for them and `npm run generate` has nothing to read. The
|
|
7
|
+
* types here follow Grafana's source at v13.2.2, cited per type. GRAF107
|
|
8
|
+
* checks these panels' envelope (the dashboard schema's `Panel`) but not
|
|
9
|
+
* their `options`; the traces panel is in the same position and keeps
|
|
10
|
+
* untyped options.
|
|
11
|
+
*/
|
|
12
|
+
import type { ThresholdsConfig, ValueMapping } from "./schema/dashboard.gen.js";
|
|
13
|
+
/**
|
|
14
|
+
* How the alert list orders rules: `SortOrder` in
|
|
15
|
+
* public/app/plugins/panel/alertlist/types.ts:4-10 (a numeric enum starting at 1).
|
|
16
|
+
* 1 alphabetical ascending, 2 descending, 3 by importance, 4 time ascending, 5 time descending.
|
|
17
|
+
*/
|
|
18
|
+
export type AlertListSortOrder = 1 | 2 | 3 | 4 | 5;
|
|
19
|
+
/** Which rule states the alert list shows: `StateFilter`, public/app/plugins/panel/alertlist/types.ts:22-30. */
|
|
20
|
+
export interface AlertListStateFilter {
|
|
21
|
+
firing: boolean;
|
|
22
|
+
pending: boolean;
|
|
23
|
+
/** Kept for dashboards saved before 9.x. */
|
|
24
|
+
inactive: boolean;
|
|
25
|
+
recovering: boolean;
|
|
26
|
+
noData: boolean;
|
|
27
|
+
normal: boolean;
|
|
28
|
+
error: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The alert list panel's options: `UnifiedAlertListOptions`,
|
|
32
|
+
* public/app/plugins/panel/alertlist/types.ts:32-49 at v13.2.2. Defaults are in
|
|
33
|
+
* public/app/plugins/panel/alertlist/module.tsx.
|
|
34
|
+
*/
|
|
35
|
+
export interface AlertListOptions {
|
|
36
|
+
maxItems: number;
|
|
37
|
+
sortOrder: AlertListSortOrder;
|
|
38
|
+
/** Only rules from the dashboard the panel is on. */
|
|
39
|
+
dashboardAlerts: boolean;
|
|
40
|
+
groupMode: "default" | "custom";
|
|
41
|
+
groupBy: string[];
|
|
42
|
+
alertName: string;
|
|
43
|
+
showInstances: boolean;
|
|
44
|
+
/** Only rules in this folder; null for any. */
|
|
45
|
+
folder: {
|
|
46
|
+
uid: string;
|
|
47
|
+
title: string;
|
|
48
|
+
} | null;
|
|
49
|
+
stateFilter: AlertListStateFilter;
|
|
50
|
+
alertInstanceLabelFilter: string;
|
|
51
|
+
/** The rule source's datasource name, or null for all. */
|
|
52
|
+
datasource: string | null;
|
|
53
|
+
viewMode: "list" | "stat";
|
|
54
|
+
showInactiveAlerts: boolean;
|
|
55
|
+
/** `BigValueColorMode`, packages/grafana-ui/src/components/BigValue/BigValueTypes.ts:8-13. */
|
|
56
|
+
statColorMode: "background" | "background_solid" | "none" | "value";
|
|
57
|
+
statThresholds: ThresholdsConfig;
|
|
58
|
+
statValueMappings: ValueMapping[];
|
|
59
|
+
}
|
|
60
|
+
/** The flame graph panel's options: `Options`, public/app/plugins/panel/flamegraph/types.ts:1-3 at v13.2.2. */
|
|
61
|
+
export interface FlameGraphOptions {
|
|
62
|
+
/** Hide the top table and show only the flame graph. */
|
|
63
|
+
showFlameGraphOnly: boolean;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=panel-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-options.d.ts","sourceRoot":"","sources":["../src/panel-options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEnD,gHAAgH;AAChH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,qDAAqD;IACrD,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,SAAS,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,+CAA+C;IAC/C,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9C,WAAW,EAAE,oBAAoB,CAAC;IAClC,wBAAwB,EAAE,MAAM,CAAC;IACjC,0DAA0D;IAC1D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8FAA8F;IAC9F,aAAa,EAAE,YAAY,GAAG,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;IACpE,cAAc,EAAE,gBAAgB,CAAC;IACjC,iBAAiB,EAAE,YAAY,EAAE,CAAC;CACnC;AAED,+GAA+G;AAC/G,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,kBAAkB,EAAE,OAAO,CAAC;CAC7B"}
|
package/dist/panels.d.ts
CHANGED
|
@@ -11,15 +11,17 @@
|
|
|
11
11
|
*
|
|
12
12
|
* `gridPos` is optional. A panel without `x` and `y` is placed by the
|
|
13
13
|
* dashboard: left to right in declaration order, wrapping at Grafana's
|
|
14
|
-
* 24-column width, below the previous row of panels
|
|
15
|
-
* placed exactly there
|
|
14
|
+
* 24-column width, below the previous row of panels, and around any cells
|
|
15
|
+
* already taken. A panel with both is placed exactly there and reserves its
|
|
16
|
+
* cells first; GRAF105 reports overlaps between explicit panels. A panel
|
|
17
|
+
* with only `x` or only `y` keeps that column or line.
|
|
16
18
|
*/
|
|
17
19
|
import type { Declarable } from "@intentius/chant/declarable";
|
|
18
20
|
import type { DeepPartial } from "./util.js";
|
|
19
21
|
import type { DatasourceInput, QueryEntity } from "./query.js";
|
|
20
22
|
import type { VariableEntity } from "./variables.js";
|
|
21
23
|
import type { SchemaName } from "./pin.js";
|
|
22
|
-
import type { DashboardLink,
|
|
24
|
+
import type { DashboardLink, FieldConfig, FieldConfigSource, GridPos } from "./schema/dashboard.gen.js";
|
|
23
25
|
import type * as timeseries from "./schema/timeseries.gen.js";
|
|
24
26
|
import type * as stat from "./schema/stat.gen.js";
|
|
25
27
|
import type * as gauge from "./schema/gauge.gen.js";
|
|
@@ -27,6 +29,19 @@ import type * as table from "./schema/table.gen.js";
|
|
|
27
29
|
import type * as logs from "./schema/logs.gen.js";
|
|
28
30
|
import type * as heatmap from "./schema/heatmap.gen.js";
|
|
29
31
|
import type * as text from "./schema/text.gen.js";
|
|
32
|
+
import type * as barchart from "./schema/barchart.gen.js";
|
|
33
|
+
import type * as bargauge from "./schema/bargauge.gen.js";
|
|
34
|
+
import type * as piechart from "./schema/piechart.gen.js";
|
|
35
|
+
import type * as statetimeline from "./schema/statetimeline.gen.js";
|
|
36
|
+
import type * as statushistory from "./schema/statushistory.gen.js";
|
|
37
|
+
import type * as histogram from "./schema/histogram.gen.js";
|
|
38
|
+
import type * as nodegraph from "./schema/nodegraph.gen.js";
|
|
39
|
+
import type * as xychart from "./schema/xychart.gen.js";
|
|
40
|
+
import type * as trend from "./schema/trend.gen.js";
|
|
41
|
+
import type * as canvas from "./schema/canvas.gen.js";
|
|
42
|
+
import type * as geomap from "./schema/geomap.gen.js";
|
|
43
|
+
import type { AlertListOptions, FlameGraphOptions } from "./panel-options.js";
|
|
44
|
+
import type { Transformation } from "./transformations.js";
|
|
30
45
|
/** `fieldConfig` with `defaults.custom` typed for the panel. */
|
|
31
46
|
export interface PanelFieldConfig<C> {
|
|
32
47
|
defaults?: DeepPartial<Omit<FieldConfig, "custom">> & {
|
|
@@ -51,7 +66,8 @@ export interface PanelProps<O = Record<string, unknown>, C = Record<string, unkn
|
|
|
51
66
|
/** The panel plugin's own options, typed from its schema. */
|
|
52
67
|
options?: DeepPartial<O>;
|
|
53
68
|
fieldConfig?: PanelFieldConfig<C>;
|
|
54
|
-
|
|
69
|
+
/** Typed per transformer: `{ id: "organize", options: { ... } }`, `transformation(id, options)`, or `customTransformation()` for an id or option the types don't know. */
|
|
70
|
+
transformations?: Transformation[];
|
|
55
71
|
links?: PanelLink[];
|
|
56
72
|
/** Repeat the panel once per value of this variable. */
|
|
57
73
|
repeat?: VariableEntity | string;
|
|
@@ -100,12 +116,12 @@ export declare function panelDefinitionFor(type: string): PanelDefinition | unde
|
|
|
100
116
|
*
|
|
101
117
|
* @example
|
|
102
118
|
* ```ts
|
|
103
|
-
* interface
|
|
119
|
+
* interface ClockOptions { mode?: "time" | "countdown"; clockType?: "24 hour" | "12 hour" }
|
|
104
120
|
*
|
|
105
|
-
* export const
|
|
106
|
-
* type: "
|
|
107
|
-
* className: "
|
|
108
|
-
* defaultSize: { w:
|
|
121
|
+
* export const ClockPanel = definePanel<ClockOptions>()({
|
|
122
|
+
* type: "grafana-clock-panel",
|
|
123
|
+
* className: "ClockPanel",
|
|
124
|
+
* defaultSize: { w: 6, h: 4 },
|
|
109
125
|
* });
|
|
110
126
|
* ```
|
|
111
127
|
*/
|
|
@@ -119,6 +135,19 @@ export declare const LogsPanel: PanelClass<"logs", logs.Options, Record<string,
|
|
|
119
135
|
export declare const TracesPanel: PanelClass<"traces", Record<string, unknown>, Record<string, unknown>>;
|
|
120
136
|
export declare const HeatmapPanel: PanelClass<"heatmap", heatmap.Options, heatmap.FieldConfig>;
|
|
121
137
|
export declare const TextPanel: PanelClass<"text", text.Options, Record<string, unknown>>;
|
|
138
|
+
export declare const BarChartPanel: PanelClass<"barchart", barchart.Options, barchart.FieldConfig>;
|
|
139
|
+
export declare const BarGaugePanel: PanelClass<"bargauge", bargauge.Options, Record<string, unknown>>;
|
|
140
|
+
export declare const PieChartPanel: PanelClass<"piechart", piechart.Options, piechart.HideableFieldConfig>;
|
|
141
|
+
export declare const StateTimelinePanel: PanelClass<"state-timeline", statetimeline.Options, statetimeline.FieldConfig>;
|
|
142
|
+
export declare const StatusHistoryPanel: PanelClass<"status-history", statushistory.Options, statushistory.FieldConfig>;
|
|
143
|
+
export declare const HistogramPanel: PanelClass<"histogram", histogram.Options, histogram.FieldConfig>;
|
|
144
|
+
export declare const NodeGraphPanel: PanelClass<"nodeGraph", nodegraph.Options, Record<string, unknown>>;
|
|
145
|
+
export declare const XYChartPanel: PanelClass<"xychart", xychart.Options, xychart.FieldConfig>;
|
|
146
|
+
export declare const TrendPanel: PanelClass<"trend", trend.Options, trend.GraphFieldConfig>;
|
|
147
|
+
export declare const CanvasPanel: PanelClass<"canvas", canvas.Options, Record<string, unknown>>;
|
|
148
|
+
export declare const GeomapPanel: PanelClass<"geomap", geomap.Options, Record<string, unknown>>;
|
|
149
|
+
export declare const FlameGraphPanel: PanelClass<"flamegraph", FlameGraphOptions, Record<string, unknown>>;
|
|
150
|
+
export declare const AlertListPanel: PanelClass<"alertlist", AlertListOptions, Record<string, unknown>>;
|
|
122
151
|
export interface RowProps {
|
|
123
152
|
title: string;
|
|
124
153
|
/** Collapsed rows keep their panels inside the row until opened. */
|
|
@@ -128,6 +157,14 @@ export interface RowProps {
|
|
|
128
157
|
repeat?: VariableEntity | string;
|
|
129
158
|
datasource?: DatasourceInput<any>;
|
|
130
159
|
id?: number;
|
|
160
|
+
/**
|
|
161
|
+
* The grid line the row header sits on. Without it, the row goes on the
|
|
162
|
+
* first free line below everything declared before it. A row header is
|
|
163
|
+
* always full width and one line high, so `y` is all it takes.
|
|
164
|
+
*/
|
|
165
|
+
gridPos?: {
|
|
166
|
+
y: number;
|
|
167
|
+
};
|
|
131
168
|
}
|
|
132
169
|
export interface RowEntity extends Declarable {
|
|
133
170
|
readonly props: RowProps;
|