@intentius/chant-lexicon-prometheus 0.105.1 → 0.106.1

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.
Files changed (80) hide show
  1. package/README.md +5 -2
  2. package/dist/build.d.ts +17 -0
  3. package/dist/build.d.ts.map +1 -1
  4. package/dist/catalog.d.ts +1 -1
  5. package/dist/catalog.d.ts.map +1 -1
  6. package/dist/composites/slo.d.ts +10 -0
  7. package/dist/composites/slo.d.ts.map +1 -1
  8. package/dist/config-model.d.ts +272 -0
  9. package/dist/config-model.d.ts.map +1 -0
  10. package/dist/detect.d.ts.map +1 -1
  11. package/dist/import/generator.d.ts +3 -1
  12. package/dist/import/generator.d.ts.map +1 -1
  13. package/dist/import/parser.d.ts +12 -2
  14. package/dist/import/parser.d.ts.map +1 -1
  15. package/dist/import/slo.d.ts.map +1 -1
  16. package/dist/index.d.ts +4 -3
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/integrity.json +5 -4
  19. package/dist/lint/audit-catalog.d.ts.map +1 -1
  20. package/dist/lint/audit-lineage.d.ts +2 -0
  21. package/dist/lint/audit-lineage.d.ts.map +1 -1
  22. package/dist/lint/post-synth/index.d.ts.map +1 -1
  23. package/dist/lint/post-synth/prom-helpers.d.ts +7 -0
  24. package/dist/lint/post-synth/prom-helpers.d.ts.map +1 -1
  25. package/dist/lint/post-synth/prom225.d.ts +10 -0
  26. package/dist/lint/post-synth/prom225.d.ts.map +1 -0
  27. package/dist/manifest.json +1 -1
  28. package/dist/meta.json +10 -0
  29. package/dist/model.d.ts +1 -0
  30. package/dist/model.d.ts.map +1 -1
  31. package/dist/okf/index.md +3 -0
  32. package/dist/okf/rules/PROM225.md +11 -0
  33. package/dist/okf/types/PrometheusConfig.md +9 -0
  34. package/dist/okf/types/ScrapeConfig.md +9 -0
  35. package/dist/plugin.d.ts.map +1 -1
  36. package/dist/prometheus-config.d.ts +39 -0
  37. package/dist/prometheus-config.d.ts.map +1 -0
  38. package/dist/rules/prom-helpers.ts +10 -1
  39. package/dist/rules/prom225.ts +19 -0
  40. package/dist/serializer.d.ts +14 -10
  41. package/dist/serializer.d.ts.map +1 -1
  42. package/dist/tools.d.ts +9 -1
  43. package/dist/tools.d.ts.map +1 -1
  44. package/dist/validate-config.d.ts +1 -1
  45. package/dist/validate-config.d.ts.map +1 -1
  46. package/dist/validate-relabel.d.ts +14 -0
  47. package/dist/validate-relabel.d.ts.map +1 -0
  48. package/dist/validate.d.ts.map +1 -1
  49. package/package.json +2 -2
  50. package/src/build.ts +73 -0
  51. package/src/catalog.ts +14 -1
  52. package/src/composites/composites.test.ts +43 -1
  53. package/src/composites/slo.ts +22 -4
  54. package/src/config-model.ts +327 -0
  55. package/src/detect.ts +5 -4
  56. package/src/generated/lexicon-prometheus.json +10 -0
  57. package/src/import/generator.ts +120 -0
  58. package/src/import/parser.test.ts +2 -2
  59. package/src/import/parser.ts +72 -5
  60. package/src/import/prometheus-roundtrip.test.ts +148 -0
  61. package/src/import/slo.ts +15 -0
  62. package/src/import/testdata/prometheus-full.yml +149 -0
  63. package/src/index.ts +20 -2
  64. package/src/lint/audit-catalog.ts +7 -0
  65. package/src/lint/audit-lineage.test.ts +1 -1
  66. package/src/lint/audit-lineage.ts +2 -0
  67. package/src/lint/post-synth/checks.test.ts +34 -0
  68. package/src/lint/post-synth/index.ts +2 -0
  69. package/src/lint/post-synth/prom-helpers.ts +10 -1
  70. package/src/lint/post-synth/prom225.ts +19 -0
  71. package/src/model.ts +1 -0
  72. package/src/plugin.test.ts +1 -0
  73. package/src/plugin.ts +1 -0
  74. package/src/prometheus-config.test.ts +230 -0
  75. package/src/prometheus-config.ts +71 -0
  76. package/src/serializer.ts +31 -21
  77. package/src/tools.ts +31 -3
  78. package/src/validate-config.ts +2 -1
  79. package/src/validate-relabel.ts +53 -0
  80. package/src/validate.ts +1 -1
package/README.md CHANGED
@@ -28,19 +28,22 @@ export { api, oncall, fallback, root };
28
28
  | `RuleGroup` | rule file |
29
29
  | `Slo` (composite) | rule file: SLI recording rules, error budget and multiwindow burn-rate alerts |
30
30
  | `GenAiRules` (composite) | rule file: request, error, latency, token and cost rules and opt-in alerts for the otel GenAI preset |
31
+ | `ScrapeConfig`, `PrometheusConfig` | `prometheus.yml`: scrape jobs with relabelling and typed kubernetes, file, http, dns, ec2 and consul discovery (other `*_sd_configs` kinds pass through untyped), plus `global`, `alerting`, `rule_files`, `remote_write`, `remote_read` and `otlp` |
31
32
  | `Route`, `Receiver` (every Alertmanager integration), `InhibitRule`, `TimeInterval`, `AlertmanagerSettings` | `alertmanager.yml` |
32
33
 
34
+ `prometheus.yml` is opt-in: a project that declares no `ScrapeConfig` or `PrometheusConfig` writes no such file. With a rule file in the build it is written beside it, otherwise it is the primary output; `prometheusConfigYaml([...])` gives the text for a set of entities, and `promtoolCheckConfig(yaml)` runs `promtool check config` over it.
35
+
33
36
  Types follow Prometheus `v3.15.0` and Alertmanager `v0.34.1` (`PROMETHEUS_PIN`).
34
37
 
35
38
  ## Importing existing files
36
39
 
37
- `chant import rules.yml --output src` and `chant import alertmanager.yml --output src` turn an existing rule file or Alertmanager config into this lexicon's TypeScript (`--lexicon prometheus` skips detection). Rules stay plain objects in a `Rule[]` const beside each `RuleGroup`; a group an `Slo()` built comes back as the `Slo` call. Routes reference receivers and time intervals by variable. `*_file` credential paths and Go templates are kept as written, and a literal credential is imported as found for PROM001 to report. `chant build` on the result gives back the same files: the round-trip tests in `src/import/roundtrip.test.ts` hold every example's output, `Slo()` output, and samples from the Prometheus docs and Alertmanager's example configs to that, and run `promtool` and `amtool` over the rebuilt files when installed.
40
+ `chant import rules.yml --output src` and `chant import alertmanager.yml --output src` (and `chant import prometheus.yml`) turn an existing rule file, Alertmanager config or Prometheus config into this lexicon's TypeScript (`--lexicon prometheus` skips detection). Rules stay plain objects in a `Rule[]` const beside each `RuleGroup`; a group an `Slo()` built comes back as the `Slo` call. Routes reference receivers and time intervals by variable. `*_file` credential paths and Go templates are kept as written, and a literal credential is imported as found for PROM001 to report. `chant build` on the result gives back the same files: the round-trip tests in `src/import/roundtrip.test.ts` hold every example's output, `Slo()` output, and samples from the Prometheus docs and Alertmanager's example configs to that, and run `promtool` and `amtool` over the rebuilt files when installed.
38
41
 
39
42
  ## Checks
40
43
 
41
44
  PROM001 to PROM003 run on source (literal credentials, PromQL syntax in literals, `Slo` objective, window and SLI literals). PROM101 to PROM107 run over the built rule file: unique group names, duplicate rules, durations, PromQL syntax, rule shape, severity labels and summaries. PROM201 to PROM210 run over `alertmanager.yml`: receivers and time intervals that exist, every alert severity routed (PROM202, one build root at a time), root route shape, matcher syntax, unused receivers, durations, and each of the 18 receiver integrations checked as Alertmanager checks it (a missing destination or credential, settings it rejects). PROM301 reads the rule file against the collector configs in the same build, and reports a spanmetrics, servicegraph or GenAI metric no collector emits, or a `by` label that is not a declared dimension.
42
45
 
43
- PROM211 to PROM219 also run over the rule file. They report alerts with no `for`, no comparison, or a template label the expression drops, and an `alertname` label set by hand. They also report `rate` over a name that is not a counter's, `histogram_quantile` without `_bucket` or `le`, recording rule names not in `level:metric:operations` form, and regex matchers that need no regex. PROM212, an alert with no `runbook_url`, is opt-in through the `all` lint preset. PROM220 to PROM224 run over `alertmanager.yml`: TLS verification turned off, SMTP or HTTP credentials sent without TLS, a `repeat_interval` under `group_interval`, and an inhibit rule with no `equal` whose two sides can match one alert.
46
+ PROM211 to PROM219 also run over the rule file. They report alerts with no `for`, no comparison, or a template label the expression drops, and an `alertname` label set by hand. They also report `rate` over a name that is not a counter's, `histogram_quantile` without `_bucket` or `le`, recording rule names not in `level:metric:operations` form, and regex matchers that need no regex. PROM212, an alert with no `runbook_url`, is opt-in through the `all` lint preset. PROM225 reports a `labeldrop` or `labelkeep` relabel step with fields it does not take, in `prometheus.yml`. PROM220 to PROM224 run over `alertmanager.yml`: TLS verification turned off, SMTP or HTTP credentials sent without TLS, a `repeat_interval` under `group_interval`, and an inhibit rule with no `equal` whose two sides can match one alert.
44
47
 
45
48
  PromQL is parsed with `@prometheus-io/lezer-promql`, the Prometheus project's own grammar. `promtoolCheckRules` and `amtoolCheckConfig` run the upstream tools when they are installed.
46
49
 
package/dist/build.d.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  import type { Declarable } from "@intentius/chant/declarable";
10
10
  import type { AlertmanagerConfig, RuleFileConfig } from "./model.js";
11
11
  import { type RuleGroupEntity } from "./rules.js";
12
+ import { type PrometheusConfigFile } from "./model.js";
12
13
  export interface BuiltRuleFile {
13
14
  config: RuleFileConfig;
14
15
  groups: RuleGroupEntity[];
@@ -24,10 +25,26 @@ export interface BuiltAlertmanager {
24
25
  }
25
26
  /** The `alertmanager.yml` for a set of declared entities. Entities that aren't Alertmanager ones are ignored. */
26
27
  export declare function buildAlertmanagerConfig(entities: Iterable<Declarable> | Map<string, Declarable>): BuiltAlertmanager;
28
+ export interface BuiltPrometheusConfig {
29
+ config: PrometheusConfigFile;
30
+ /** Non-fatal problems, e.g. two scrape jobs with one name. */
31
+ warnings: string[];
32
+ /** Every `PrometheusConfig` and `ScrapeConfig` that took part. */
33
+ count: number;
34
+ }
35
+ /**
36
+ * The `prometheus.yml` for a set of declared entities. Entities that aren't
37
+ * `PrometheusConfig`s or `ScrapeConfig`s are ignored. Sections come out in the
38
+ * order Prometheus documents them, and scrape jobs are sorted by name: the
39
+ * jobs are independent, so their order carries no meaning.
40
+ */
41
+ export declare function buildPrometheusConfig(entities: Iterable<Declarable> | Map<string, Declarable>): BuiltPrometheusConfig;
27
42
  /** Print a rule file or Alertmanager config as YAML, keys in the order given. */
28
43
  export declare function emitYaml(value: unknown): string;
29
44
  /** The rule file YAML for a set of declared entities, exactly as the serializer emits it. */
30
45
  export declare function ruleFileYaml(entities: Iterable<Declarable> | Map<string, Declarable>): string;
31
46
  /** The `alertmanager.yml` text for a set of declared entities, exactly as the serializer emits it. */
32
47
  export declare function alertmanagerYaml(entities: Iterable<Declarable> | Map<string, Declarable>): string;
48
+ /** The `prometheus.yml` text for a set of declared entities, exactly as the serializer emits it. */
49
+ export declare function prometheusConfigYaml(entities: Iterable<Declarable> | Map<string, Declarable>): string;
33
50
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAc9D,OAAO,KAAK,EACV,kBAAkB,EAIlB,cAAc,EAEf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAgC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AA4B7E,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,aAAa,CAUrG;AAID,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,yDAAyD;IACzD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,0FAA0F;IAC1F,KAAK,EAAE,MAAM,CAAC;CACf;AA+BD,iHAAiH;AACjH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,iBAAiB,CAkEnH;AAID,iFAAiF;AACjF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE/C;AAED,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAE7F;AAED,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,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B,CA0CrH;AAID,iFAAiF;AACjF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE/C;AAED,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAE7F;AAED,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAEjG;AAED,oGAAoG;AACpG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAErG"}
package/dist/catalog.d.ts CHANGED
@@ -8,7 +8,7 @@ export interface CatalogEntry {
8
8
  className: string;
9
9
  entityType: string;
10
10
  /** The file the entity serializes into. */
11
- file: "rule file" | "alertmanager.yml";
11
+ file: "rule file" | "prometheus.yml" | "alertmanager.yml";
12
12
  description: string;
13
13
  }
14
14
  export declare const CATALOG: CatalogEntry[];
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAI3E,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,IAAI,EAAE,WAAW,GAAG,kBAAkB,CAAC;IACvC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,OAAO,EAAE,YAAY,EAqCjC,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAM9D"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAK3E,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,IAAI,EAAE,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;IAC1D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,OAAO,EAAE,YAAY,EAiDjC,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAM9D"}
@@ -14,6 +14,16 @@
14
14
  * pair's factor: the long window keeps a short spike from paging, the
15
15
  * short window stops the alert soon after the burn does.
16
16
  *
17
+ * An SLI that sees no events in a window (a sparse one: a job that runs a few
18
+ * times a day) records no ratio for that window, where good/total would be
19
+ * 0/0 and record NaN. The SLO window's ratio is an average of the shortest
20
+ * recorded ratio, and one NaN in a range keeps `avg_over_time` NaN for the
21
+ * whole window, so the idle windows are left out and the average covers only
22
+ * the windows that had events. The SLI expressions are the caller's: `rate()`
23
+ * over a counter that first appears inside the range sees one sample and
24
+ * counts nothing, so a sparse SLI should count events as an increase that
25
+ * includes a series' first sample (see the SLOs page).
26
+ *
17
27
  * Both kinds share a group because Prometheus evaluates a group's rules in
18
28
  * order: the alerts read the ratios recorded in the same evaluation. In
19
29
  * separate groups they would read the previous evaluation's, and with an
@@ -1 +1 @@
1
- {"version":3,"file":"slo.d.ts","sourceRoot":"","sources":["../../src/composites/slo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAA+D,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAC7G,OAAO,K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AAE,MAAM,CAAA;KAAE,CAAC;IACxB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6FAA6F;IAC7F,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,CAAC;IACzB,sFAAsF;IACtF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qFAAqF;AACrF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,QAAQ,EAAE,SAAS,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAStG,CAAC;AA8GH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG,SAAS,CAkB5E;AAED,6DAA6D;AAC7D,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQhE;AAiGD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,GAAG,sEAYP,CAAC;AAEV;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,eAAe,GAAG,QAAQ,GAAG,UAAU,CAOpF"}
@@ -0,0 +1,272 @@
1
+ /**
2
+ * The plain-data model of `prometheus.yml`: global settings, scrape configs,
3
+ * relabelling, service discovery, Alertmanager targets and remote storage.
4
+ *
5
+ * Written by hand against Prometheus v3.15.0 (`config/config.go` and
6
+ * `discovery/*`), field names in the file's own snake_case. SchemaStore's
7
+ * `prometheus.json` is not used to generate these: it is strict about unknown
8
+ * keys and behind v3.15.0 (no `runtime`, `otlp` or `tracing`, 11 of about 20
9
+ * `global` keys, 24 of 32 discovery kinds), so types generated from it would
10
+ * reject configs Prometheus accepts.
11
+ *
12
+ * Six discovery kinds are typed: kubernetes, file, http, dns, ec2 and consul.
13
+ * Any other `<kind>_sd_configs` key is carried as untyped data.
14
+ */
15
+ import type { HttpClientConfig } from "./integrations.js";
16
+ import type { LabelSet } from "./model.js";
17
+ /** One `static_configs` entry: fixed targets and the labels they share. */
18
+ export interface StaticConfig {
19
+ /** `host:port` addresses to scrape (or, under `alerting`, to send alerts to). */
20
+ targets: string[];
21
+ labels?: LabelSet;
22
+ }
23
+ /** The actions a relabel step can take. */
24
+ export type RelabelAction = "replace" | "lowercase" | "uppercase" | "keep" | "drop" | "keepequal" | "dropequal" | "hashmod" | "labelmap" | "labeldrop" | "labelkeep";
25
+ /** One `relabel_configs` / `metric_relabel_configs` / `write_relabel_configs` step. */
26
+ export interface RelabelConfig {
27
+ /** Labels whose values are joined with `separator` and matched against `regex`. */
28
+ source_labels?: string[];
29
+ /** Defaults to `;`. */
30
+ separator?: string;
31
+ target_label?: string;
32
+ /** An RE2 regex, anchored. Defaults to `(.*)`. */
33
+ regex?: string;
34
+ modulus?: number;
35
+ /** Defaults to `$1`. */
36
+ replacement?: string;
37
+ /** Defaults to `replace`. */
38
+ action?: RelabelAction;
39
+ }
40
+ /** `kubernetes_sd_configs` entry. */
41
+ export interface KubernetesSDConfig extends HttpClientConfig {
42
+ role: "pod" | "service" | "endpoints" | "endpointslice" | "node" | "ingress";
43
+ kubeconfig_file?: string;
44
+ api_server?: string;
45
+ namespaces?: {
46
+ own_namespace?: boolean;
47
+ names?: string[];
48
+ };
49
+ selectors?: Array<{
50
+ role: string;
51
+ label?: string;
52
+ field?: string;
53
+ }>;
54
+ attach_metadata?: {
55
+ node?: boolean;
56
+ namespace?: boolean;
57
+ };
58
+ }
59
+ /** `file_sd_configs` entry: target files Prometheus re-reads. */
60
+ export interface FileSDConfig {
61
+ /** Paths or globs of YAML and JSON target files. */
62
+ files: string[];
63
+ refresh_interval?: string;
64
+ }
65
+ /** `http_sd_configs` entry: targets fetched from a URL. */
66
+ export interface HttpSDConfig extends HttpClientConfig {
67
+ url: string;
68
+ refresh_interval?: string;
69
+ }
70
+ /** `dns_sd_configs` entry. */
71
+ export interface DnsSDConfig {
72
+ names: string[];
73
+ /** `SRV` (default), `A`, `AAAA`, `MX` or `NS`. */
74
+ type?: "SRV" | "A" | "AAAA" | "MX" | "NS";
75
+ /** Required for every type but `SRV`. */
76
+ port?: number;
77
+ refresh_interval?: string;
78
+ }
79
+ /** `ec2_sd_configs` entry. */
80
+ export interface Ec2SDConfig extends HttpClientConfig {
81
+ region?: string;
82
+ endpoint?: string;
83
+ /** A credential: prefer the environment or an instance role. */
84
+ access_key?: string;
85
+ secret_key?: string;
86
+ profile?: string;
87
+ role_arn?: string;
88
+ refresh_interval?: string;
89
+ port?: number;
90
+ filters?: Array<{
91
+ name: string;
92
+ values: string[];
93
+ }>;
94
+ }
95
+ /** `consul_sd_configs` entry. */
96
+ export interface ConsulSDConfig extends HttpClientConfig {
97
+ server?: string;
98
+ /** A credential. */
99
+ token?: string;
100
+ datacenter?: string;
101
+ namespace?: string;
102
+ partition?: string;
103
+ scheme?: "http" | "https";
104
+ username?: string;
105
+ password?: string;
106
+ allow_stale?: boolean;
107
+ services?: string[];
108
+ tags?: string[];
109
+ tag_separator?: string;
110
+ node_meta?: Record<string, string>;
111
+ refresh_interval?: string;
112
+ filter?: string;
113
+ }
114
+ /** The service discovery lists of a scrape config or an Alertmanager target group. */
115
+ export interface ServiceDiscoveryConfigs {
116
+ kubernetes_sd_configs?: KubernetesSDConfig[];
117
+ file_sd_configs?: FileSDConfig[];
118
+ http_sd_configs?: HttpSDConfig[];
119
+ dns_sd_configs?: DnsSDConfig[];
120
+ ec2_sd_configs?: Ec2SDConfig[];
121
+ consul_sd_configs?: ConsulSDConfig[];
122
+ /** Any other discovery kind (`azure_sd_configs`, `gce_sd_configs`, ...), carried as written. */
123
+ [other: `${string}_sd_configs`]: unknown[] | undefined;
124
+ }
125
+ /** The discovery kinds typed above. */
126
+ export declare const TYPED_SD_KINDS: readonly string[];
127
+ /** Limits and histogram settings that exist both in `global` and per scrape config. */
128
+ export interface ScrapeDefaults {
129
+ scrape_interval?: string;
130
+ scrape_timeout?: string;
131
+ /** e.g. `PrometheusProto`, `OpenMetricsText1.0.0`, `PrometheusText0.0.4`. */
132
+ scrape_protocols?: string[];
133
+ body_size_limit?: string;
134
+ sample_limit?: number;
135
+ label_limit?: number;
136
+ label_name_length_limit?: number;
137
+ label_value_length_limit?: number;
138
+ target_limit?: number;
139
+ keep_dropped_targets?: number;
140
+ always_scrape_classic_histograms?: boolean;
141
+ convert_classic_histograms_to_nhcb?: boolean;
142
+ metric_name_validation_scheme?: "utf8" | "legacy";
143
+ metric_name_escaping_scheme?: "allow-utf-8" | "underscores" | "dots" | "values";
144
+ native_histogram_bucket_limit?: number;
145
+ native_histogram_min_bucket_factor?: number;
146
+ }
147
+ /** One scrape job. */
148
+ export interface ScrapeJobConfig extends ScrapeDefaults, HttpClientConfig, ServiceDiscoveryConfigs {
149
+ /** Unique across the file; the `job` label on every target. */
150
+ job_name: string;
151
+ honor_labels?: boolean;
152
+ honor_timestamps?: boolean;
153
+ track_timestamps_staleness?: boolean;
154
+ fallback_scrape_protocol?: string;
155
+ /** Defaults to `/metrics`. */
156
+ metrics_path?: string;
157
+ /** `http` (default) or `https`. */
158
+ scheme?: "http" | "https";
159
+ /** URL query parameters sent with every scrape. */
160
+ params?: Record<string, string[]>;
161
+ enable_compression?: boolean;
162
+ static_configs?: StaticConfig[];
163
+ relabel_configs?: RelabelConfig[];
164
+ metric_relabel_configs?: RelabelConfig[];
165
+ }
166
+ /** `global:`. */
167
+ export interface PrometheusGlobalConfig extends ScrapeDefaults {
168
+ evaluation_interval?: string;
169
+ rule_query_offset?: string;
170
+ /** Labels added to every series sent to remote storage and every alert. */
171
+ external_labels?: LabelSet;
172
+ query_log_file?: string;
173
+ scrape_failure_log_file?: string;
174
+ }
175
+ /** One `alerting.alertmanagers` entry. */
176
+ export interface AlertmanagerTarget extends HttpClientConfig, ServiceDiscoveryConfigs {
177
+ timeout?: string;
178
+ api_version?: "v2";
179
+ path_prefix?: string;
180
+ scheme?: "http" | "https";
181
+ relabel_configs?: RelabelConfig[];
182
+ alert_relabel_configs?: RelabelConfig[];
183
+ static_configs?: StaticConfig[];
184
+ }
185
+ /** `alerting:`. */
186
+ export interface PrometheusAlertingConfig {
187
+ alert_relabel_configs?: RelabelConfig[];
188
+ alertmanagers?: AlertmanagerTarget[];
189
+ }
190
+ /** `remote_write[].queue_config`. */
191
+ export interface QueueConfig {
192
+ capacity?: number;
193
+ max_shards?: number;
194
+ min_shards?: number;
195
+ max_samples_per_send?: number;
196
+ batch_send_deadline?: string;
197
+ min_backoff?: string;
198
+ max_backoff?: string;
199
+ retry_on_http_429?: boolean;
200
+ sample_age_limit?: string;
201
+ }
202
+ /** One `remote_write` entry. */
203
+ export interface RemoteWriteConfig extends HttpClientConfig {
204
+ url: string;
205
+ name?: string;
206
+ remote_timeout?: string;
207
+ headers?: Record<string, string>;
208
+ write_relabel_configs?: RelabelConfig[];
209
+ send_exemplars?: boolean;
210
+ send_native_histograms?: boolean;
211
+ queue_config?: QueueConfig;
212
+ metadata_config?: {
213
+ send?: boolean;
214
+ send_interval?: string;
215
+ max_samples_per_send?: number;
216
+ };
217
+ sigv4?: {
218
+ region?: string;
219
+ access_key?: string;
220
+ secret_key?: string;
221
+ profile?: string;
222
+ role_arn?: string;
223
+ };
224
+ azuread?: Record<string, unknown>;
225
+ google_iam?: Record<string, unknown>;
226
+ }
227
+ /** One `remote_read` entry. */
228
+ export interface RemoteReadConfig extends HttpClientConfig {
229
+ url: string;
230
+ name?: string;
231
+ remote_timeout?: string;
232
+ headers?: Record<string, string>;
233
+ read_recent?: boolean;
234
+ required_matchers?: LabelSet;
235
+ filter_external_labels?: boolean;
236
+ }
237
+ /** `otlp:`: how OTLP metrics pushed to Prometheus become series. */
238
+ export interface OtlpConfig {
239
+ promote_all_resource_attributes?: boolean;
240
+ promote_resource_attributes?: string[];
241
+ ignore_resource_attributes?: string[];
242
+ translation_strategy?: "UnderscoreEscapingWithSuffixes" | "UnderscoreEscapingWithoutSuffixes" | "NoUTF8EscapingWithSuffixes" | "NoTranslation";
243
+ keep_identifying_resource_attributes?: boolean;
244
+ convert_histograms_to_nhcb?: boolean;
245
+ }
246
+ /** The sections of a `prometheus.yml` besides its scrape jobs. */
247
+ export interface PrometheusConfigSections {
248
+ global?: PrometheusGlobalConfig;
249
+ alerting?: PrometheusAlertingConfig;
250
+ /** Paths or globs of rule files, relative to the config file. */
251
+ rule_files?: string[];
252
+ /** Paths or globs of files holding more `scrape_configs`. */
253
+ scrape_config_files?: string[];
254
+ remote_write?: RemoteWriteConfig[];
255
+ remote_read?: RemoteReadConfig[];
256
+ otlp?: OtlpConfig;
257
+ /** TSDB and exemplar settings, carried as written. */
258
+ storage?: Record<string, unknown>;
259
+ /** Where Prometheus sends its own traces, carried as written. */
260
+ tracing?: Record<string, unknown>;
261
+ /** Go runtime settings (`gogc`), carried as written. */
262
+ runtime?: Record<string, unknown>;
263
+ }
264
+ /** A whole `prometheus.yml`. */
265
+ export interface PrometheusConfigFile extends PrometheusConfigSections {
266
+ scrape_configs?: ScrapeJobConfig[];
267
+ }
268
+ /** Top-level keys of `prometheus.yml`, in the order Prometheus documents them. */
269
+ export declare const PROMETHEUS_CONFIG_SECTIONS: readonly string[];
270
+ /** True when a parsed document has the shape of a `prometheus.yml`. */
271
+ export declare function looksLikePrometheusConfig(value: unknown): value is PrometheusConfigFile;
272
+ //# sourceMappingURL=config-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-model.d.ts","sourceRoot":"","sources":["../src/config-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,gB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D"}
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAErD"}
@@ -21,7 +21,7 @@
21
21
  */
22
22
  import type { GeneratedFile, TypeScriptGenerator } from "@intentius/chant/import/generator";
23
23
  import type { TemplateIR } from "@intentius/chant/import/parser";
24
- import type { AlertmanagerConfig, RuleFileConfig } from "../model.js";
24
+ import type { AlertmanagerConfig, PrometheusConfigFile, RuleFileConfig } from "../model.js";
25
25
  /** A value as a TypeScript expression, starting at column `col`, indented by `indent` spaces. */
26
26
  export declare function tsLiteral(v: unknown, indent: number, col?: number): string;
27
27
  /** Generate the TypeScript declaring one rule file. */
@@ -57,6 +57,8 @@ export declare function generateAlertmanager(config: AlertmanagerConfig): {
57
57
  files: GeneratedFile[];
58
58
  declarations: AlertmanagerDeclaration[];
59
59
  };
60
+ /** Generate the TypeScript declaring one `prometheus.yml`. */
61
+ export declare function generatePrometheusConfigFiles(config: PrometheusConfigFile): GeneratedFile[];
60
62
  /** The rule file and `alertmanager.yml` TypeScript generator `chant import` runs. */
61
63
  export declare class PrometheusGenerator implements TypeScriptGenerator {
62
64
  generate(ir: TemplateIR): GeneratedFile[];
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/import/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EACV,kBAAkB,EAIlB,cAAc,EAGf,MAAM,UAAU,CAAC;AAmFlB,iGAAiG;AACjG,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,CAmB1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2
+ * Rule file, `prometheus.yml` or `alertmanager.yml` -> `TemplateIR`, for `chant import`.
3
3
  *
4
4
  * Either file is one document whose parts name each other (a route names a
5
5
  * receiver and time intervals), so the IR carries the whole file as one
@@ -18,11 +18,17 @@
18
18
  * and the top-level `mute_time_intervals` list joins `time_intervals`.
19
19
  */
20
20
  import type { TemplateIR, TemplateParser } from "@intentius/chant/import/parser";
21
- import { type AlertmanagerConfig, type RuleFileConfig } from "../model.js";
21
+ import { type AlertmanagerConfig, type RuleFileConfig, type PrometheusConfigFile } from "../model.js";
22
22
  /** The IR resource type for a whole rule file. */
23
23
  export declare const RULE_FILE_RESOURCE_TYPE = "Prometheus::RuleFile";
24
24
  /** The IR resource type for a whole `alertmanager.yml`. */
25
25
  export declare const ALERTMANAGER_RESOURCE_TYPE = "Prometheus::Alertmanager::Config";
26
+ /** The IR resource type for a whole `prometheus.yml`. */
27
+ export declare const PROMETHEUS_RESOURCE_TYPE = "Prometheus::Config";
28
+ /** `properties` of the `Prometheus::Config` resource. */
29
+ export interface PrometheusResourceProperties {
30
+ config: PrometheusConfigFile;
31
+ }
26
32
  /** `properties` of the `Prometheus::RuleFile` resource. */
27
33
  export interface RuleFileResourceProperties {
28
34
  file: RuleFileConfig;
@@ -40,6 +46,10 @@ export type ParsedPrometheusFile = {
40
46
  kind: "alertmanager";
41
47
  config: AlertmanagerConfig;
42
48
  warnings: string[];
49
+ } | {
50
+ kind: "prometheus";
51
+ config: PrometheusConfigFile;
52
+ warnings: string[];
43
53
  };
44
54
  /** A matcher string Alertmanager parses back to `name op value`. */
45
55
  export declare function matcherString(name: string, op: "=" | "=~", value: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/import/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAKL,KAAK,kBAAkB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,EAAuB,MAAM,mBAAmB,CAAC;AAG3I,OAAO,EAAuF,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AA8DrI,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,QAAQ,GAAG,SAAS,CAiGzE"}
1
+ {"version":3,"file":"slo.d.ts","sourceRoot":"","sources":["../../src/import/slo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAsE,KAAK,QAAQ,EAAuB,MAAM,mBAAmB,CAAC;AAG3I,OAAO,EAAuF,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AA6ErI,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,QAAQ,GAAG,SAAS,CAiGzE"}
package/dist/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  export { prometheusPlugin } from "./plugin.js";
2
- export { prometheusSerializer, ALERTMANAGER_FILE } from "./serializer.js";
2
+ export { prometheusSerializer, ALERTMANAGER_FILE, PROMETHEUS_FILE } from "./serializer.js";
3
3
  export { RuleGroup, RULE_GROUP_TYPE, isRuleGroup, ruleGroupConfig, ruleConfig, type RuleGroupProps, type RuleGroupEntity, type Rule, type RecordingRule, type AlertingRule, } from "./rules.js";
4
4
  export { Route, Receiver, InhibitRule, TimeInterval, AlertmanagerSettings, ROUTE_TYPE, RECEIVER_TYPE, INHIBIT_RULE_TYPE, TIME_INTERVAL_TYPE, SETTINGS_TYPE, isRoute, isReceiver, isInhibitRule, isTimeInterval, isAlertmanagerSettings, isAlertmanagerEntity, type RouteProps, type RouteEntity, type ReceiverProps, type ReceiverEntity, type ReceiverRef, type InhibitRuleProps, type InhibitRuleEntity, type TimeIntervalProps, type TimeIntervalEntity, type TimeIntervalRef, type AlertmanagerSettingsProps, type AlertmanagerSettingsEntity, } from "./alertmanager.js";
5
+ export { PrometheusConfig, ScrapeConfig, PROMETHEUS_CONFIG_TYPE, SCRAPE_CONFIG_TYPE, isPrometheusConfig, isScrapeConfig, isPrometheusConfigEntity, type PrometheusConfigProps, type PrometheusConfigEntity, type ScrapeConfigProps, type ScrapeConfigEntity, } from "./prometheus-config.js";
5
6
  export * from "./model.js";
6
- export { buildRuleFile, buildAlertmanagerConfig, ruleFileYaml, alertmanagerYaml, emitYaml, type BuiltRuleFile, type BuiltAlertmanager, } from "./build.js";
7
+ export { buildRuleFile, buildAlertmanagerConfig, buildPrometheusConfig, ruleFileYaml, alertmanagerYaml, prometheusConfigYaml, emitYaml, type BuiltRuleFile, type BuiltAlertmanager, type BuiltPrometheusConfig, } from "./build.js";
7
8
  export { isValidDuration, durationMs, formatDuration } from "./duration.js";
8
9
  export { parseMatchers, matcherMatches, matcher, type Matcher, type MatchOp, type ParsedMatchers } from "./matchers.js";
9
10
  export { checkPromql, PROMQL_GRAMMAR, type PromqlCheck } from "./promql.js";
10
11
  export { validateRuleFile, validateRunbookUrls, validateAlertmanagerConfig, validateSeverityRouting, alertSeverities, type PrometheusIssue, type PrometheusIssueCode, } from "./validate-config.js";
11
12
  export { PROMETHEUS_PIN } from "./pin.js";
12
- export { promtoolCheckRules, promtoolTestRules, amtoolCheckConfig, hasTool, type ToolResult } from "./tools.js";
13
+ export { promtoolCheckRules, promtoolCheckConfig, promtoolTestRules, amtoolCheckConfig, hasTool, type ToolResult } from "./tools.js";
13
14
  export { Slo, sloMetrics, sloPropsProblem, sliExprProblem, DEFAULT_BURN_RATES, SLO_WINDOW_PLACEHOLDER, type SloProps, type SloSli, type SloAlerting, type SloAlertTier, type BurnRateWindow, type SloMembers, type SloInstance, type SloMetrics, type SloBurnRate, GenAiRules, genAiRuleMetrics, type GenAiRulesProps, type GenAiRulesMembers, type GenAiRulesInstance, type GenAiRuleMetrics, type GenAiPrice, type GenAiAlerting, type GenAiAlertOptions, type GenAiRatioAlert, type GenAiLatencyAlert, type GenAiBudget, type GenAiAlertInfo, type GenAiQuantileSeries, } from "./composites/index.js";
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGvE,OAAO,EACL,SAAS,EACT,eAAe,EACf,WAAW,EACX,eAAe,EACf,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,OAAO,EACP,UAAU,EACV,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,GAChC,MAAM,gBAAgB,CAAC;AAGxB,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AACrH,OAAO,EAAE,WAAW,EAAE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ACnB,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAGlI,OAAO,EACL,GAAG,EACH,UAAU,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,UAAU,EACV,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC"}
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "3d4ab83c660e7b5a640408266e6a531595b9a8a3c5e22529f7eca2fc489c970c",
5
- "meta.json": "6aeeb24f8a09f61582620870021cdb0d781690d4a9d0efebc729d054df3eaebb",
4
+ "manifest.json": "53c257204b76845f6c6091849e84f26bb4881c7d53bf6f414477e461a83a3dad",
5
+ "meta.json": "a06b8059e2de2ca6c8131bfbbfe7e143e818f2d2d497d3f45a9bc5c63af6aeeb",
6
6
  "types/index.d.ts": "150d72287453a24a40cdeffb8cf3e9dc6e77ab58b342b48d01902dc58fb5f85d",
7
7
  "rules/literal-credential.ts": "1ea8b768e9dc4a6d7b133a52923ce2e8cb815584d3eeb1854f77af34d50f8257",
8
8
  "rules/prom-ast.ts": "6de6f83cfa81505efeb2c55aa1e9872ead9b09695a400c92bec8fa11059a551f",
9
9
  "rules/promql-literal.ts": "c734b6d9f0949ac7529edd6e687f7a5a1e62f37e614492f0e92e7062260e85db",
10
10
  "rules/slo-literal.ts": "13f86da17d11939ebbcf64be38b092b602f6c9e95876e1615c00a032638d75b1",
11
- "rules/prom-helpers.ts": "7e79dcdbdd9274c5c5988861c970f44e558f6fb26db1298b37869ba9c60d078a",
11
+ "rules/prom-helpers.ts": "1c7aa83f7635096fe3364c959f5c0376e74187529a0ccc8bf0602d47d0ada8dd",
12
12
  "rules/prom101.ts": "f153c2b0b5f43b51e15053d732f27321aeb33c76683416b47982a95986704935",
13
13
  "rules/prom102.ts": "d40d7d4690ada12efcf50c471739b2254376cbd382c1d8c547bbadca3205a1fa",
14
14
  "rules/prom103.ts": "7801469c838023083ef3c196fffc6ab71b05270dba439fc19cb1dc383a6a8f64",
@@ -40,10 +40,11 @@
40
40
  "rules/prom222.ts": "fe5cdf757a9d714462e1a1e884c8995e3c2afb5fd39bace2a53001a981a94e31",
41
41
  "rules/prom223.ts": "6fe7c4c33b8f4e617be851875b4d4bc365c071b4561bc42b6b3885bf5b9b3af6",
42
42
  "rules/prom224.ts": "7ebb892f9158da33fcc7f8c6ddef14d72675a7f14c9cfb9c5d7336974546c42e",
43
+ "rules/prom225.ts": "3b6a59718a899af3af214153d4e25ade7d8b5e15291d2c37ee0b9578634c97c3",
43
44
  "rules/prom301.ts": "2574209407b9cf8d1157540db0d99632e8e16df69306fe8f4453a6689a518557",
44
45
  "skills/chant-prometheus.md": "842db9fa6329b486b95987aa93e1542af52436aa326c02275854e64b51946edb",
45
46
  "skills/chant-prometheus-alertmanager.md": "4c4a22bea6147653d09d7d3f55f81c4927963d4e2f50b2e430fbb9023e99570b",
46
47
  "skills/chant-prometheus-kubernetes.md": "cca016857891f4cabf1feb6f9db83c220a2e6ece200cd89e635851079f8070a8"
47
48
  },
48
- "composite": "c91cd6691850aec7e6b41a030d4382e8eede83204fdae3fecde0fe7f1401195d"
49
+ "composite": "7702d4256b5e3ef42ef7888b0b068e875a7487dc7171c17ebf43fb52a4c31e23"
49
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAiBxF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAyM3D,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,CAAwB,CAAC"}
1
+ {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAiBxF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAgN3D,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,CAAwB,CAAC"}
@@ -46,6 +46,8 @@
46
46
  * - PROM220-PROM224: check-config accepts insecure_skip_verify, SMTP auth
47
47
  * without TLS, credentials over http://, a repeat_interval under
48
48
  * group_interval, and an inhibit rule without equal.
49
+ * - PROM225: promtool check config rejects it, but the check reads a built
50
+ * prometheus.yml, which no tool above does.
49
51
  * - PROM301: no tool here reads a rule file together with the collector
50
52
  * config that produces its metrics.
51
53
  */
@@ -1 +1 @@
1
- {"version":3,"file":"audit-lineage.d.ts","sourceRoot":"","sources":["../../src/lint/audit-lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAY9D,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAiC5D,CAAC"}
1
+ {"version":3,"file":"audit-lineage.d.ts","sourceRoot":"","sources":["../../src/lint/audit-lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAY9D,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAiC5D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAkCvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAiC3C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAmCvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAkC3C,CAAC"}
@@ -10,6 +10,7 @@
10
10
  * declared.
11
11
  */
12
12
  import type { PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
13
+ import { type PrometheusConfigFile } from "../../config-model.js";
13
14
  import { type AlertmanagerConfig, type RuleFileConfig } from "../../model.js";
14
15
  import { type PrometheusIssueCode } from "../../validate-config.js";
15
16
  export interface FoundDocs {
@@ -21,6 +22,10 @@ export interface FoundDocs {
21
22
  source: string;
22
23
  config: AlertmanagerConfig;
23
24
  }>;
25
+ prometheus: Array<{
26
+ source: string;
27
+ config: PrometheusConfigFile;
28
+ }>;
24
29
  }
25
30
  /** Every rule file and Alertmanager config in the output. Parsed with js-yaml rather than `ctx.docs`, which keeps block scalars and flow lists as strings. */
26
31
  export declare function prometheusDocs(ctx: PostSynthContext): FoundDocs;
@@ -28,6 +33,8 @@ export declare function prometheusDocs(ctx: PostSynthContext): FoundDocs;
28
33
  export declare function ruleFileDiagnostics(ctx: PostSynthContext, code: PrometheusIssueCode): PostSynthDiagnostic[];
29
34
  /** Diagnostics for one Alertmanager code (PROM201, PROM203-PROM210, PROM220-PROM224) across every `alertmanager.yml` in the output. */
30
35
  export declare function alertmanagerDiagnostics(ctx: PostSynthContext, code: PrometheusIssueCode): PostSynthDiagnostic[];
36
+ /** PROM225 across every `prometheus.yml` in the output. */
37
+ export declare function relabelDiagnostics(ctx: PostSynthContext): PostSynthDiagnostic[];
31
38
  /** PROM212 across every rule file in the output. Opt-in: the lexicon's `recommended` lint preset leaves it out (see ../../plugin.ts). */
32
39
  export declare function runbookDiagnostics(ctx: PostSynthContext): PostSynthDiagnostic[];
33
40
  /**