You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
prometheus: observe and reconcile against Alertmanager and the Mimir, Cortex and Loki rulers #3371
area:lifecycleplan/diff/apply/observe/drift/prune/search --livearea:otelOpenTelemetry, collector, and observability lexiconsenhancementNew feature or requestfollowup:lexicon-maturityFollow-up to epic #2960 (otel, prometheus, grafana maturity); candidate for the next epic
Neither otel nor prometheus implements describeResources, observeResourcesDeep or exportResources. Both have parsers that reconcile can reuse. grafana is the model (#2946: lexicons/grafana/src/plugin.ts:181-196).
Reconcile first
Alertmanager: GET /api/v2/status returns config.original, the stored YAML, which the existing parser takes as is.
Mimir ruler: GET /prometheus/config/v1/rules[/{namespace}] returns rule groups as YAML, with X-Scope-OrgID. Loki: /loki/api/v1/rules. Cortex: /api/v1/rules (Mimir does not register that path).
Plain Prometheus: /api/v1/rules returns evaluated rules (query, duration, labels, annotations, health, lastError), not file contents, so it needs a mapping to RuleGroupConfig. Second.
src/import/slo.ts already rebuilds an Slo when the groups match it, so live import keeps composites.
Observe
describeResources keyed by rule group for targets with an API, and by the Alertmanager config.
Ownership
Rule files carry no marker (src/serializer.ts:20). On a ruler, the namespaces the project declares are the boundary, as a stack bounds CloudFormation deletes.
Acceptance criteria
chant import --from <env> reconciles Alertmanager config and ruler groups into prometheus source.
describeResources reports declared groups and their health.
Done in #3580 (343154d) and #3583 (e71e9ee, two test expectations): chant import --from <env> reads Mimir, Cortex and Loki ruler groups and the Alertmanager config (/api/v2/status, or Mimir/Cortex /api/v1/alerts) into prometheus source, groups an Slo built coming back as Slo(...); plain Prometheus /api/v1/rules is mapped too, lossy, with a warning. describeResources reports each declared RuleGroup's health, first rule error and firing/pending counts. The declared ruler namespaces (prometheus.profiles.<env>.ruler) bound every read. At v0.34.1 /api/v2/status returns the loaded config with defaults filled in and secrets masked, not the stored YAML; the importer strips the added defaults (--verbatim keeps them) and warns on each masked secret. The client is @intentius/chant-lexicon-prometheus/api, which #3372 reuses. Tests pass on main against fake rulers and Alertmanagers on localhost: describe-resources, export-resources, alertmanager-live, evaluated, config, plugin (6 files, 75 tests). Not run against a real Mimir or Alertmanager.
Released in chant 0.107.1 (npm). 0.107.0 was tagged at fae3aae but never published: its publish gate timed out waiting for CI on a commit whose tests were red. #3589, #3590 and #3591 fixed the tests, and 0.107.1 published from e4b2d42.
area:lifecycleplan/diff/apply/observe/drift/prune/search --livearea:otelOpenTelemetry, collector, and observability lexiconsenhancementNew feature or requestfollowup:lexicon-maturityFollow-up to epic #2960 (otel, prometheus, grafana maturity); candidate for the next epic
Activity
feat(prometheus): describeResources and chant import --from read Mimi…
fix(prometheus): the live export test expects the slo-<name> group an…
lex00 commentedon Oct 6, 2026
Done in #3580 (343154d) and #3583 (e71e9ee, two test expectations):
chant import --from <env>reads Mimir, Cortex and Loki ruler groups and the Alertmanager config (/api/v2/status, or Mimir/Cortex/api/v1/alerts) into prometheus source, groups an Slo built coming back asSlo(...); plain Prometheus/api/v1/rulesis mapped too, lossy, with a warning.describeResourcesreports each declared RuleGroup's health, first rule error and firing/pending counts. The declared ruler namespaces (prometheus.profiles.<env>.ruler) bound every read. At v0.34.1/api/v2/statusreturns the loaded config with defaults filled in and secrets masked, not the stored YAML; the importer strips the added defaults (--verbatimkeeps them) and warns on each masked secret. The client is@intentius/chant-lexicon-prometheus/api, which #3372 reuses. Tests pass on main against fake rulers and Alertmanagers on localhost: describe-resources, export-resources, alertmanager-live, evaluated, config, plugin (6 files, 75 tests). Not run against a real Mimir or Alertmanager.lex00 commentedon Oct 6, 2026
Released in chant 0.107.1 (npm). 0.107.0 was tagged at fae3aae but never published: its publish gate timed out waiting for CI on a commit whose tests were red. #3589, #3590 and #3591 fixed the tests, and 0.107.1 published from e4b2d42.