@intentius/chant-lexicon-prometheus 0.102.0 → 0.104.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 +3 -1
- package/dist/collector-metrics.d.ts +58 -0
- package/dist/collector-metrics.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +19 -4
- package/dist/lint/audit-catalog.d.ts +2 -0
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/audit-lineage.d.ts +21 -0
- package/dist/lint/audit-lineage.d.ts.map +1 -1
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/prom-helpers.d.ts +9 -2
- package/dist/lint/post-synth/prom-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/prom211.d.ts +12 -0
- package/dist/lint/post-synth/prom211.d.ts.map +1 -0
- package/dist/lint/post-synth/prom212.d.ts +9 -0
- package/dist/lint/post-synth/prom212.d.ts.map +1 -0
- package/dist/lint/post-synth/prom213.d.ts +11 -0
- package/dist/lint/post-synth/prom213.d.ts.map +1 -0
- package/dist/lint/post-synth/prom214.d.ts +9 -0
- package/dist/lint/post-synth/prom214.d.ts.map +1 -0
- package/dist/lint/post-synth/prom215.d.ts +9 -0
- package/dist/lint/post-synth/prom215.d.ts.map +1 -0
- package/dist/lint/post-synth/prom216.d.ts +10 -0
- package/dist/lint/post-synth/prom216.d.ts.map +1 -0
- package/dist/lint/post-synth/prom217.d.ts +9 -0
- package/dist/lint/post-synth/prom217.d.ts.map +1 -0
- package/dist/lint/post-synth/prom218.d.ts +10 -0
- package/dist/lint/post-synth/prom218.d.ts.map +1 -0
- package/dist/lint/post-synth/prom219.d.ts +9 -0
- package/dist/lint/post-synth/prom219.d.ts.map +1 -0
- package/dist/lint/post-synth/prom220.d.ts +9 -0
- package/dist/lint/post-synth/prom220.d.ts.map +1 -0
- package/dist/lint/post-synth/prom221.d.ts +10 -0
- package/dist/lint/post-synth/prom221.d.ts.map +1 -0
- package/dist/lint/post-synth/prom222.d.ts +9 -0
- package/dist/lint/post-synth/prom222.d.ts.map +1 -0
- package/dist/lint/post-synth/prom223.d.ts +10 -0
- package/dist/lint/post-synth/prom223.d.ts.map +1 -0
- package/dist/lint/post-synth/prom224.d.ts +9 -0
- package/dist/lint/post-synth/prom224.d.ts.map +1 -0
- package/dist/lint/post-synth/prom301.d.ts +14 -0
- package/dist/lint/post-synth/prom301.d.ts.map +1 -0
- package/dist/lint/rules/literal-credential.d.ts.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/okf/index.md +15 -0
- package/dist/okf/rules/PROM211.md +11 -0
- package/dist/okf/rules/PROM212.md +11 -0
- package/dist/okf/rules/PROM213.md +11 -0
- package/dist/okf/rules/PROM214.md +11 -0
- package/dist/okf/rules/PROM215.md +11 -0
- package/dist/okf/rules/PROM216.md +11 -0
- package/dist/okf/rules/PROM217.md +11 -0
- package/dist/okf/rules/PROM218.md +11 -0
- package/dist/okf/rules/PROM219.md +11 -0
- package/dist/okf/rules/PROM220.md +11 -0
- package/dist/okf/rules/PROM221.md +11 -0
- package/dist/okf/rules/PROM222.md +11 -0
- package/dist/okf/rules/PROM223.md +11 -0
- package/dist/okf/rules/PROM224.md +11 -0
- package/dist/okf/rules/PROM301.md +11 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/promql-analysis.d.ts +82 -0
- package/dist/promql-analysis.d.ts.map +1 -0
- package/dist/rules/literal-credential.ts +4 -0
- package/dist/rules/prom-helpers.ts +41 -2
- package/dist/rules/prom211.ts +21 -0
- package/dist/rules/prom212.ts +18 -0
- package/dist/rules/prom213.ts +20 -0
- package/dist/rules/prom214.ts +18 -0
- package/dist/rules/prom215.ts +18 -0
- package/dist/rules/prom216.ts +19 -0
- package/dist/rules/prom217.ts +18 -0
- package/dist/rules/prom218.ts +19 -0
- package/dist/rules/prom219.ts +18 -0
- package/dist/rules/prom220.ts +18 -0
- package/dist/rules/prom221.ts +19 -0
- package/dist/rules/prom222.ts +18 -0
- package/dist/rules/prom223.ts +19 -0
- package/dist/rules/prom224.ts +18 -0
- package/dist/rules/prom301.ts +23 -0
- package/dist/validate-config.d.ts +9 -3
- package/dist/validate-config.d.ts.map +1 -1
- package/dist/validate-integrations.d.ts +1 -0
- package/dist/validate-integrations.d.ts.map +1 -1
- package/dist/validate-security.d.ts +13 -0
- package/dist/validate-security.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/collector-metrics.ts +262 -0
- package/src/composites/composites.test.ts +2 -5
- package/src/import/testdata/alertmanager-integrations.yml +5 -1
- package/src/index.ts +1 -0
- package/src/init-templates.test.ts +3 -1
- package/src/lint/audit-catalog.ts +102 -0
- package/src/lint/audit-lineage.test.ts +74 -0
- package/src/lint/audit-lineage.ts +28 -0
- package/src/lint/post-synth/checks.test.ts +257 -0
- package/src/lint/post-synth/index.ts +30 -0
- package/src/lint/post-synth/post-synth.test.ts +3 -1
- package/src/lint/post-synth/prom-helpers.ts +41 -2
- package/src/lint/post-synth/prom211.ts +21 -0
- package/src/lint/post-synth/prom212.ts +18 -0
- package/src/lint/post-synth/prom213.ts +20 -0
- package/src/lint/post-synth/prom214.ts +18 -0
- package/src/lint/post-synth/prom215.ts +18 -0
- package/src/lint/post-synth/prom216.ts +19 -0
- package/src/lint/post-synth/prom217.ts +18 -0
- package/src/lint/post-synth/prom218.ts +19 -0
- package/src/lint/post-synth/prom219.ts +18 -0
- package/src/lint/post-synth/prom220.ts +18 -0
- package/src/lint/post-synth/prom221.ts +19 -0
- package/src/lint/post-synth/prom222.ts +18 -0
- package/src/lint/post-synth/prom223.ts +19 -0
- package/src/lint/post-synth/prom224.ts +18 -0
- package/src/lint/post-synth/prom301.test.ts +157 -0
- package/src/lint/post-synth/prom301.ts +23 -0
- package/src/lint/rules/literal-credential.ts +4 -0
- package/src/lint/rules/rules.test.ts +16 -0
- package/src/plugin.test.ts +22 -0
- package/src/plugin.ts +12 -1
- package/src/promql-analysis.ts +365 -0
- package/src/validate-config.ts +274 -5
- package/src/validate-integrations.ts +1 -1
- package/src/validate-security.ts +143 -0
package/README.md
CHANGED
|
@@ -38,7 +38,9 @@ Types follow Prometheus `v3.15.0` and Alertmanager `v0.34.1` (`PROMETHEUS_PIN`).
|
|
|
38
38
|
|
|
39
39
|
## Checks
|
|
40
40
|
|
|
41
|
-
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).
|
|
41
|
+
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
|
+
|
|
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.
|
|
42
44
|
|
|
43
45
|
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.
|
|
44
46
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The metric names the collector configs in a build emit through their
|
|
3
|
+
* `spanmetrics`, `servicegraph`, `sum` and `signaltometrics` connectors (the
|
|
4
|
+
* last two are how the otel GenAI preset counts tokens and derives the
|
|
5
|
+
* conventions' client metrics), and the PromQL that reads under those
|
|
6
|
+
* connectors' namespaces without matching one of them (PROM301).
|
|
7
|
+
*
|
|
8
|
+
* Grafana's GRAF118 runs `collectorMetricIssues` over panel queries; the
|
|
9
|
+
* prometheus lexicon runs it over rule files. Names follow the otel lexicon's
|
|
10
|
+
* `metric-names.ts`, with each config's `prometheus` and
|
|
11
|
+
* `prometheusremotewrite` exporters' `namespace` and `add_metric_suffixes`.
|
|
12
|
+
* A component under a renamed type (`span_metrics`, `service_graph`,
|
|
13
|
+
* `signal_to_metrics`) is read as the built-in it names, through the otel
|
|
14
|
+
* lexicon's `canonicalTypeOf`.
|
|
15
|
+
*
|
|
16
|
+
* Collector configs come from two places. `chant build` gives a lexicon's
|
|
17
|
+
* checks only that lexicon's output, but every entity in the build, so the
|
|
18
|
+
* otel lexicon's own config is rebuilt from the build's otel entities with
|
|
19
|
+
* `buildCollectorConfig`. Any output document shaped like a collector config,
|
|
20
|
+
* or a Kubernetes ConfigMap holding one, is read as well.
|
|
21
|
+
*/
|
|
22
|
+
import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
|
|
23
|
+
import { type CollectorConfig } from "@intentius/chant-lexicon-otel/model";
|
|
24
|
+
/** One metric a collector config emits, as Prometheus sees it. */
|
|
25
|
+
export interface EmittedMetric {
|
|
26
|
+
/** The connector that emits it, e.g. `spanmetrics/genai`. */
|
|
27
|
+
connector: string;
|
|
28
|
+
/** The labels a series of it can carry; undefined when the exporter adds every resource attribute. */
|
|
29
|
+
labels?: Set<string>;
|
|
30
|
+
}
|
|
31
|
+
/** What the collector configs in a build emit. */
|
|
32
|
+
export interface CollectorMetrics {
|
|
33
|
+
/** The name prefixes the connectors own, e.g. `traces_span_metrics_`. */
|
|
34
|
+
namespaces: string[];
|
|
35
|
+
/** Every emitted Prometheus name. A histogram is its `_bucket`, `_sum` and `_count` series. */
|
|
36
|
+
metrics: Map<string, EmittedMetric[]>;
|
|
37
|
+
}
|
|
38
|
+
/** Every collector config in the build: rebuilt from its otel entities, and found in its output. */
|
|
39
|
+
export declare function buildCollectorConfigs(ctx: PostSynthContext): CollectorConfig[];
|
|
40
|
+
/** The metrics the collector configs emit; undefined when there are none. */
|
|
41
|
+
export declare function collectorMetrics(configs: CollectorConfig[]): CollectorMetrics | undefined;
|
|
42
|
+
export interface CollectorMetricIssue {
|
|
43
|
+
kind: "name" | "label";
|
|
44
|
+
metric: string;
|
|
45
|
+
label?: string;
|
|
46
|
+
message: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* What a PromQL expression reads under the build's connector namespaces and
|
|
50
|
+
* the build does not emit: a metric name no connector writes, and a
|
|
51
|
+
* `by (...)` label none of the aggregated metrics carries. A name outside
|
|
52
|
+
* every namespace is not read. An aggregation is checked only when every
|
|
53
|
+
* series under it is an emitted metric and nothing under it adds a label
|
|
54
|
+
* (`label_replace`, `label_join`). Selectors come from the lexicon's
|
|
55
|
+
* `promql-analysis.ts`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function collectorMetricIssues(expr: string, emitted: CollectorMetrics): CollectorMetricIssue[];
|
|
58
|
+
//# sourceMappingURL=collector-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector-metrics.d.ts","sourceRoot":"","sources":["../src/collector-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAezE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAM5F,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,sGAAsG;IACtG,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,+FAA+F;IAC/F,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;CACvC;AA+BD,oGAAoG;AACpG,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,eAAe,EAAE,CAK9E;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,gBAAgB,GAAG,SAAS,CA6FzF;AAyBD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,oBAAoB,EAAE,CA8BrG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { buildRuleFile, buildAlertmanagerConfig, ruleFileYaml, alertmanagerYaml,
|
|
|
7
7
|
export { isValidDuration, durationMs, formatDuration } from "./duration.js";
|
|
8
8
|
export { parseMatchers, matcherMatches, matcher, type Matcher, type MatchOp, type ParsedMatchers } from "./matchers.js";
|
|
9
9
|
export { checkPromql, PROMQL_GRAMMAR, type PromqlCheck } from "./promql.js";
|
|
10
|
-
export { validateRuleFile, validateAlertmanagerConfig, validateSeverityRouting, alertSeverities, type PrometheusIssue, type PrometheusIssueCode, } from "./validate-config.js";
|
|
10
|
+
export { validateRuleFile, validateRunbookUrls, validateAlertmanagerConfig, validateSeverityRouting, alertSeverities, type PrometheusIssue, type PrometheusIssueCode, } from "./validate-config.js";
|
|
11
11
|
export { PROMETHEUS_PIN } from "./pin.js";
|
|
12
12
|
export { promtoolCheckRules, promtoolTestRules, amtoolCheckConfig, hasTool, type ToolResult } from "./tools.js";
|
|
13
13
|
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";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,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,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EACL,gBAAgB,EAChB,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,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAG7G,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
|
+
{"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,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,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,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAG7G,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"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "6dd07ad408d55335396f03486bd6fe114b8cf44e865d75141b97b4de096bd756",
|
|
5
5
|
"meta.json": "6aeeb24f8a09f61582620870021cdb0d781690d4a9d0efebc729d054df3eaebb",
|
|
6
6
|
"types/index.d.ts": "150d72287453a24a40cdeffb8cf3e9dc6e77ab58b342b48d01902dc58fb5f85d",
|
|
7
|
-
"rules/literal-credential.ts": "
|
|
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": "
|
|
11
|
+
"rules/prom-helpers.ts": "7e79dcdbdd9274c5c5988861c970f44e558f6fb26db1298b37869ba9c60d078a",
|
|
12
12
|
"rules/prom101.ts": "f153c2b0b5f43b51e15053d732f27321aeb33c76683416b47982a95986704935",
|
|
13
13
|
"rules/prom102.ts": "d40d7d4690ada12efcf50c471739b2254376cbd382c1d8c547bbadca3205a1fa",
|
|
14
14
|
"rules/prom103.ts": "7801469c838023083ef3c196fffc6ab71b05270dba439fc19cb1dc383a6a8f64",
|
|
@@ -26,9 +26,24 @@
|
|
|
26
26
|
"rules/prom208.ts": "7806675771732014956dc66e010d0b1ae4cdca11468632d2431a3bab263e1295",
|
|
27
27
|
"rules/prom209.ts": "b33524371960cf3d1c207eba6971731685dd04daeaaa8e522ffee43af35cc1b6",
|
|
28
28
|
"rules/prom210.ts": "0b98f92b9f78aee6664dab0d261660035a54dcc59a7d596cc80f8f972297a0ec",
|
|
29
|
+
"rules/prom211.ts": "e9212c375f489188dc5d328d63f5084a36cd50d0b156d216d40a3474345d4058",
|
|
30
|
+
"rules/prom212.ts": "10f0de5407332045d0040107aa3410fa26aa5fff87440472b7846c8258c25041",
|
|
31
|
+
"rules/prom213.ts": "5d2ed2ac68d7abfb70c66b1419711b44f6cb879be6ee8b2440a6b94f5a68acb6",
|
|
32
|
+
"rules/prom214.ts": "d6b15469cc47da26eaf9c68dba77b799e44a574094b5fc570af1dfbd2a29104c",
|
|
33
|
+
"rules/prom215.ts": "e65d90373879d2e9ed4d2738d9f681bc3c1cee1a99fb4736501b97fe8f3dfb62",
|
|
34
|
+
"rules/prom216.ts": "6d13a425f894817e9b6300a3271a223e67de1fc19d68d3dcb0783d09bdb6f105",
|
|
35
|
+
"rules/prom217.ts": "9b52d59e6004a792f059ae579080b0ac365ebe37b01e9ad17794ede2d5fc3d03",
|
|
36
|
+
"rules/prom218.ts": "33eb54bf60cc9eee3a4aac15ce81922abfbae6b664eaf1985c649e6420261fe7",
|
|
37
|
+
"rules/prom219.ts": "a50e0a24d6bbae2f11f394fb8b844a56a3bc7e1d4bb617ebf060e160eb736295",
|
|
38
|
+
"rules/prom220.ts": "75001ec27cd8a7591f028cd23814c2a67a941ad7e80d224738b383c83194d81f",
|
|
39
|
+
"rules/prom221.ts": "d314ed016d08ba2facab4d50da22adf70fce9d74887adb395b25a4b3fbe232b1",
|
|
40
|
+
"rules/prom222.ts": "fe5cdf757a9d714462e1a1e884c8995e3c2afb5fd39bace2a53001a981a94e31",
|
|
41
|
+
"rules/prom223.ts": "6fe7c4c33b8f4e617be851875b4d4bc365c071b4561bc42b6b3885bf5b9b3af6",
|
|
42
|
+
"rules/prom224.ts": "7ebb892f9158da33fcc7f8c6ddef14d72675a7f14c9cfb9c5d7336974546c42e",
|
|
43
|
+
"rules/prom301.ts": "2574209407b9cf8d1157540db0d99632e8e16df69306fe8f4453a6689a518557",
|
|
29
44
|
"skills/chant-prometheus.md": "842db9fa6329b486b95987aa93e1542af52436aa326c02275854e64b51946edb",
|
|
30
45
|
"skills/chant-prometheus-alertmanager.md": "4c4a22bea6147653d09d7d3f55f81c4927963d4e2f50b2e430fbb9023e99570b",
|
|
31
46
|
"skills/chant-prometheus-kubernetes.md": "cca016857891f4cabf1feb6f9db83c220a2e6ece200cd89e635851079f8070a8"
|
|
32
47
|
},
|
|
33
|
-
"composite": "
|
|
48
|
+
"composite": "8d324a969da4588e9b601194bb74fd3cb09818e2ee6b8006d0a21b2e372e5054"
|
|
34
49
|
}
|
|
@@ -10,4 +10,6 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { type RuleMeta } from "@intentius/chant/audit/catalog";
|
|
12
12
|
export declare const prometheusAuditCatalog: Record<string, RuleMeta>;
|
|
13
|
+
/** Post-synth checks the `recommended` lint preset leaves out (#3363); see `prometheusPlugin.lintPresets()`. */
|
|
14
|
+
export declare const OPT_IN_CHECKS: ReadonlySet<string>;
|
|
13
15
|
//# sourceMappingURL=audit-catalog.d.ts.map
|
|
@@ -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,
|
|
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"}
|
|
@@ -21,12 +21,33 @@
|
|
|
21
21
|
* configurable "this label or annotation must exist" checks that pint ships
|
|
22
22
|
* with nothing enabled, so they overlap PROM106 and PROM107 and no more.
|
|
23
23
|
*
|
|
24
|
+
* The PROM211-PROM219 rule-file checks (#3363), against the same list:
|
|
25
|
+
* - alerts/comparison and promql/regexp are the same checks as PROM213 and
|
|
26
|
+
* PROM218, so those are equivalent.
|
|
27
|
+
* - rule/for enforces a configured minimum `for`, and alerts/annotation a
|
|
28
|
+
* configured annotation; with `for` required and runbook_url named they
|
|
29
|
+
* are PROM211 and PROM212. alerts/for is not credited: it rejects bad
|
|
30
|
+
* values and a redundant `for: 0s`, not a missing `for`.
|
|
31
|
+
* - alerts/template covers PROM214's dropped label and checks template
|
|
32
|
+
* syntax besides. promql/rate reads the metric type from a live
|
|
33
|
+
* Prometheus's metadata; PROM215 has only the name to go on. rule/name
|
|
34
|
+
* is a configured name regex; PROM217 fixes it to level:metric:operations.
|
|
35
|
+
* All three overlap.
|
|
36
|
+
*
|
|
24
37
|
* Deliberately without a credit from these tools:
|
|
25
38
|
* - PROM001 and PROM003: a literal credential in TypeScript source, and the
|
|
26
39
|
* Slo objective/window model. Neither tool reads either.
|
|
27
40
|
* - PROM202 (severity not routed) and PROM207 (receiver never routed to):
|
|
28
41
|
* check-config accepts both, and `amtool config routes test` answers a
|
|
29
42
|
* different question (where one given label set goes).
|
|
43
|
+
* - PROM216 (histogram_quantile without _bucket or le) and PROM219
|
|
44
|
+
* (alertname set by hand): no pint check reports either, and promtool's
|
|
45
|
+
* rulefmt accepts both.
|
|
46
|
+
* - PROM220-PROM224: check-config accepts insecure_skip_verify, SMTP auth
|
|
47
|
+
* without TLS, credentials over http://, a repeat_interval under
|
|
48
|
+
* group_interval, and an inhibit rule without equal.
|
|
49
|
+
* - PROM301: no tool here reads a rule file together with the collector
|
|
50
|
+
* config that produces its metrics.
|
|
30
51
|
*/
|
|
31
52
|
import type { Lineage } from "@intentius/chant/audit/catalog";
|
|
32
53
|
export declare const prometheusAuditLineage: Record<string, Lineage[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-lineage.d.ts","sourceRoot":"","sources":["../../src/lint/audit-lineage.ts"],"names":[],"mappings":"AAAA
|
|
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 +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;
|
|
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"}
|
|
@@ -24,10 +24,17 @@ export interface FoundDocs {
|
|
|
24
24
|
}
|
|
25
25
|
/** 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
26
|
export declare function prometheusDocs(ctx: PostSynthContext): FoundDocs;
|
|
27
|
-
/** Diagnostics for one rule-file code (PROM101-PROM107) across every rule file in the output. */
|
|
27
|
+
/** Diagnostics for one rule-file code (PROM101-PROM107, PROM211, PROM213-PROM219) across every rule file in the output. */
|
|
28
28
|
export declare function ruleFileDiagnostics(ctx: PostSynthContext, code: PrometheusIssueCode): PostSynthDiagnostic[];
|
|
29
|
-
/** Diagnostics for one Alertmanager code (PROM201, PROM203-PROM210) across every `alertmanager.yml` in the output. */
|
|
29
|
+
/** Diagnostics for one Alertmanager code (PROM201, PROM203-PROM210, PROM220-PROM224) across every `alertmanager.yml` in the output. */
|
|
30
30
|
export declare function alertmanagerDiagnostics(ctx: PostSynthContext, code: PrometheusIssueCode): PostSynthDiagnostic[];
|
|
31
|
+
/** PROM212 across every rule file in the output. Opt-in: the lexicon's `recommended` lint preset leaves it out (see ../../plugin.ts). */
|
|
32
|
+
export declare function runbookDiagnostics(ctx: PostSynthContext): PostSynthDiagnostic[];
|
|
33
|
+
/**
|
|
34
|
+
* PROM301: every rule expression in the output against the metrics the
|
|
35
|
+
* build's collector configs emit. Silent when the build has none.
|
|
36
|
+
*/
|
|
37
|
+
export declare function collectorMetricDiagnostics(ctx: PostSynthContext): PostSynthDiagnostic[];
|
|
31
38
|
/** PROM202: joins every rule file in the output against every Alertmanager config in it. Silent when either is absent. */
|
|
32
39
|
export declare function routingDiagnostics(ctx: PostSynthContext): PostSynthDiagnostic[];
|
|
33
40
|
//# sourceMappingURL=prom-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prom-helpers.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"prom-helpers.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAI9F,OAAO,EAAkD,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3H,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,cAAc,CAAA;KAAE,CAAC,CAAC;IAC7D,YAAY,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;CACrE;AAED,8JAA8J;AAC9J,wBAAgB,cAAc,CAAC,GAAG,EAAE,gBAAgB,GAAG,SAAS,CAsB/D;AAYD,2HAA2H;AAC3H,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,mBAAmB,GAAG,mBAAmB,EAAE,CAM3G;AAED,uIAAuI;AACvI,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,mBAAmB,GAAG,mBAAmB,EAAE,CAM/G;AAED,yIAAyI;AACzI,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,CAE/E;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,CA0BvF;AAED,0HAA0H;AAC1H,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,CAK/E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM211: An alerting rule has no for, or for: 0s
|
|
3
|
+
*
|
|
4
|
+
* The alert fires on the first evaluation that matches, so one bad scrape
|
|
5
|
+
* pages. Left alone when the expression reads no series (vector(1), a dead
|
|
6
|
+
* man's switch) or already spans a window: every selector read through a
|
|
7
|
+
* *_over_time function, or two conditions joined by and (the multi-window
|
|
8
|
+
* burn-rate form, where the short window does what for would).
|
|
9
|
+
*/
|
|
10
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
11
|
+
export declare const prom211: PostSynthCheck;
|
|
12
|
+
//# sourceMappingURL=prom211.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom211.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom211.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM212: An alerting rule has no runbook_url annotation (opt-in)
|
|
3
|
+
*
|
|
4
|
+
* Off unless enabled: the lint preset all, or a lint.rules entry for PROM212,
|
|
5
|
+
* turns it on. See validateRunbookUrls.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const prom212: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=prom212.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom212.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom212.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM213: An alert expression has no comparison
|
|
3
|
+
*
|
|
4
|
+
* Every series the expression returns is an alert, so an expression with no
|
|
5
|
+
* comparison fires for all of them. absent(), absent_over_time() and unless
|
|
6
|
+
* count as a condition; a comparison with bool does not. An expression that
|
|
7
|
+
* reads no series (vector(1), a dead man's switch) is left alone.
|
|
8
|
+
*/
|
|
9
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
10
|
+
export declare const prom213: PostSynthCheck;
|
|
11
|
+
//# sourceMappingURL=prom213.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom213.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom213.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM214: An alert template reads a label the expression aggregates away
|
|
3
|
+
*
|
|
4
|
+
* A $labels.x whose x the expression's by (...) leaves out, or its without
|
|
5
|
+
* (...) names, renders empty. Labels the rule or its group set are left alone.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const prom214: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=prom214.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom214.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom214.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM215: rate, irate or increase over a name that is not a counter's
|
|
3
|
+
*
|
|
4
|
+
* These functions treat every drop as a counter reset. A name not ending in
|
|
5
|
+
* _total, _count, _sum or _bucket is read as a gauge.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const prom215: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=prom215.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom215.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom215.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM216: histogram_quantile over a series without _bucket, or without le
|
|
3
|
+
*
|
|
4
|
+
* A classic histogram's quantile needs its _bucket series with the le label
|
|
5
|
+
* kept. A native histogram has no _bucket series, so this check does not apply
|
|
6
|
+
* to one.
|
|
7
|
+
*/
|
|
8
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
9
|
+
export declare const prom216: PostSynthCheck;
|
|
10
|
+
//# sourceMappingURL=prom216.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom216.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom216.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM217: A recording rule name is not in level:metric:operations form
|
|
3
|
+
*
|
|
4
|
+
* Prometheus's naming convention for recorded series, e.g.
|
|
5
|
+
* job:http_requests:rate5m.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const prom217: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=prom217.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom217.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom217.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM218: A regex matcher needs no regex, or is anchored
|
|
3
|
+
*
|
|
4
|
+
* A =~ or !~ with no regex metacharacters is an equality matcher written the
|
|
5
|
+
* slow way. Prometheus anchors every regex, so a leading ^ or trailing $ does
|
|
6
|
+
* nothing.
|
|
7
|
+
*/
|
|
8
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
9
|
+
export declare const prom218: PostSynthCheck;
|
|
10
|
+
//# sourceMappingURL=prom218.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom218.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom218.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM219: An alerting rule sets the alertname label
|
|
3
|
+
*
|
|
4
|
+
* Prometheus sets alertname to the rule's name after applying the rule's
|
|
5
|
+
* labels, so the value is overwritten.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const prom219: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=prom219.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom219.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom219.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM220: A receiver turns off TLS certificate verification
|
|
3
|
+
*
|
|
4
|
+
* tls_config.insecure_skip_verify: true on a receiver, or in global, accepts
|
|
5
|
+
* any certificate the endpoint presents.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const prom220: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=prom220.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom220.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom220.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM221: SMTP credentials sent with require_tls false
|
|
3
|
+
*
|
|
4
|
+
* An email receiver with SMTP auth and require_tls false (its own, or
|
|
5
|
+
* global.smtp_require_tls) can send the credentials in clear text. Implicit
|
|
6
|
+
* TLS is left alone.
|
|
7
|
+
*/
|
|
8
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
9
|
+
export declare const prom221: PostSynthCheck;
|
|
10
|
+
//# sourceMappingURL=prom221.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom221.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom221.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM222: Credentials sent to an http:// receiver URL
|
|
3
|
+
*
|
|
4
|
+
* An integration whose URL is http:// and whose request carries a credential:
|
|
5
|
+
* user info in the URL, http_config auth, or a key or token field.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const prom222: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=prom222.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom222.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom222.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM223: repeat_interval is shorter than group_interval
|
|
3
|
+
*
|
|
4
|
+
* Alertmanager resends only when it flushes a group, every group_interval, so
|
|
5
|
+
* a shorter repeat_interval never takes effect. Intervals are inherited down
|
|
6
|
+
* the routing tree from Alertmanager's defaults.
|
|
7
|
+
*/
|
|
8
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
9
|
+
export declare const prom223: PostSynthCheck;
|
|
10
|
+
//# sourceMappingURL=prom223.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom223.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom223.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM224: An inhibit rule matches one alert as source and target, with no equal
|
|
3
|
+
*
|
|
4
|
+
* With no equal, any alert matching the source mutes every alert matching the
|
|
5
|
+
* target. When one alert can match both, alerts of that kind mute each other.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const prom224: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=prom224.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom224.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom224.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROM301: A rule reads a connector metric no collector in the build emits
|
|
3
|
+
*
|
|
4
|
+
* For each selector in a rule whose name falls under a namespace the build's
|
|
5
|
+
* spanmetrics, servicegraph or GenAI connectors own (spanmetrics' and
|
|
6
|
+
* servicegraph's defaults included), reports a name no collector config in
|
|
7
|
+
* the build emits, and a by (...) label that is not a dimension the config
|
|
8
|
+
* declares for the metrics aggregated. Silent for names outside those
|
|
9
|
+
* namespaces, and when the build has no collector config. See
|
|
10
|
+
* ../../collector-metrics.ts.
|
|
11
|
+
*/
|
|
12
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
13
|
+
export declare const prom301: PostSynthCheck;
|
|
14
|
+
//# sourceMappingURL=prom301.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prom301.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/prom301.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAOrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"literal-credential.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/literal-credential.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"literal-credential.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/literal-credential.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAIxF;;;GAGG;AACH,eAAO,MAAM,aAAa,aA8BxB,CAAC;AAYH;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,EAAE,QA+DnC,CAAC"}
|
package/dist/manifest.json
CHANGED
package/dist/okf/index.md
CHANGED
|
@@ -33,3 +33,18 @@ okf_version: '0.2'
|
|
|
33
33
|
* [PROM208](/rules/PROM208.md) - An Alertmanager duration is not a duration
|
|
34
34
|
* [PROM209](/rules/PROM209.md) - A receiver integration is missing its destination or credential
|
|
35
35
|
* [PROM210](/rules/PROM210.md) - A receiver integration or global setting is one Alertmanager rejects
|
|
36
|
+
* [PROM211](/rules/PROM211.md) - An alerting rule has no for, or for: 0s
|
|
37
|
+
* [PROM212](/rules/PROM212.md) - An alerting rule has no runbook_url annotation (opt-in)
|
|
38
|
+
* [PROM213](/rules/PROM213.md) - An alert expression has no comparison
|
|
39
|
+
* [PROM214](/rules/PROM214.md) - An alert template reads a label the expression aggregates away
|
|
40
|
+
* [PROM215](/rules/PROM215.md) - rate, irate or increase over a name that is not a counter's
|
|
41
|
+
* [PROM216](/rules/PROM216.md) - histogram_quantile over a series without _bucket, or without le
|
|
42
|
+
* [PROM217](/rules/PROM217.md) - A recording rule name is not in level:metric:operations form
|
|
43
|
+
* [PROM218](/rules/PROM218.md) - A regex matcher needs no regex, or is anchored
|
|
44
|
+
* [PROM219](/rules/PROM219.md) - An alerting rule sets the alertname label
|
|
45
|
+
* [PROM220](/rules/PROM220.md) - A receiver turns off TLS certificate verification
|
|
46
|
+
* [PROM221](/rules/PROM221.md) - SMTP credentials sent with require_tls false
|
|
47
|
+
* [PROM222](/rules/PROM222.md) - Credentials sent to an http:// receiver URL
|
|
48
|
+
* [PROM223](/rules/PROM223.md) - repeat_interval is shorter than group_interval
|
|
49
|
+
* [PROM224](/rules/PROM224.md) - An inhibit rule matches one alert as source and target, with no equal
|
|
50
|
+
* [PROM301](/rules/PROM301.md) - A rule reads a connector metric no collector in the build emits
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: PROM211
|
|
4
|
+
description: 'An alerting rule has no for, or for: 0s'
|
|
5
|
+
id: PROM211
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: prometheus
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/prometheus/rules/
|
|
10
|
+
---
|
|
11
|
+
An alerting rule has no for, or for: 0s
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: PROM212
|
|
4
|
+
description: An alerting rule has no runbook_url annotation (opt-in)
|
|
5
|
+
id: PROM212
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: prometheus
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/prometheus/rules/
|
|
10
|
+
---
|
|
11
|
+
An alerting rule has no runbook_url annotation (opt-in)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: PROM213
|
|
4
|
+
description: An alert expression has no comparison
|
|
5
|
+
id: PROM213
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: prometheus
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/prometheus/rules/
|
|
10
|
+
---
|
|
11
|
+
An alert expression has no comparison
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: PROM214
|
|
4
|
+
description: An alert template reads a label the expression aggregates away
|
|
5
|
+
id: PROM214
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: prometheus
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/prometheus/rules/
|
|
10
|
+
---
|
|
11
|
+
An alert template reads a label the expression aggregates away
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: PROM215
|
|
4
|
+
description: rate, irate or increase over a name that is not a counter's
|
|
5
|
+
id: PROM215
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: prometheus
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/prometheus/rules/
|
|
10
|
+
---
|
|
11
|
+
rate, irate or increase over a name that is not a counter's
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: PROM216
|
|
4
|
+
description: histogram_quantile over a series without _bucket, or without le
|
|
5
|
+
id: PROM216
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: prometheus
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/prometheus/rules/
|
|
10
|
+
---
|
|
11
|
+
histogram_quantile over a series without _bucket, or without le
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: PROM217
|
|
4
|
+
description: A recording rule name is not in level:metric:operations form
|
|
5
|
+
id: PROM217
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: prometheus
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/prometheus/rules/
|
|
10
|
+
---
|
|
11
|
+
A recording rule name is not in level:metric:operations form
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: PROM218
|
|
4
|
+
description: A regex matcher needs no regex, or is anchored
|
|
5
|
+
id: PROM218
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: prometheus
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/prometheus/rules/
|
|
10
|
+
---
|
|
11
|
+
A regex matcher needs no regex, or is anchored
|