Alertmanager
@magistr/alertmanagerv2026.10.25.10
01README
Prometheus Alertmanager v2 API for swamp — list firing alerts, alert groups and silences, read server status, and create/extend or expire silences idempotently.
Model:
@magistr/alertmanager— talks to/api/v2/*on an Alertmanager. Methods:alerts(active, unsilenced, uninhibited by default, with label matcher and receiver filters),groups(as the routing tree groups them),silences(by state and matchers),status(version, uptime, cluster; the running config is stored as a SHA-256 only, because it can hold receiver secrets),create-silence(reuses or extends an existing silence with the same matchers and comment), andexpire-silence(reads first; an already-expired silence is left alone).
02Release Notes
2026.10.25.10
- Repo-wide republish; no functional change.
03Behaviors
@magistr/alertmanagerv2026.10.25.10extensions/models/alertmanager.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| url | string | Alertmanager base URL, e.g. http://alertmanager.example:9093 |
| timeoutMs? | number | Per-request timeout in milliseconds |
fn alerts(unprocessed?: boolean)
List alerts. Defaults to active, not silenced, not inhibited — the alerts that are notifying now.
| Argument | Type | Description |
|---|---|---|
| unprocessed? | boolean | Include alerts not yet processed by the dispatcher |
fn groups()
List alert groups as the routing tree groups them
fn silences(state?: enum, filter?: string)
List silences, filtered by state and label matchers
| Argument | Type | Description |
|---|---|---|
| state? | enum | Silence state to keep |
| filter? | string | Label matchers, comma-separated, as for alerts |
fn status()
Read server version, uptime and cluster state. The running config is hashed, not stored — it can hold receiver secrets.
fn create-silence(matchers: string, durationMinutes?: number, comment: string, createdBy?: string)
Silence alerts matching the given matchers. Idempotent: an existing active/pending silence with the same matchers and comment is reused, and extended only if it would end sooner than requested.
| Argument | Type | Description |
|---|---|---|
| matchers | string | Label matchers, comma-separated: alertname="X",instance="y" |
| durationMinutes? | number | How long the silence lasts, from now |
| comment | string | Why the alerts are silenced |
| createdBy? | string | Author recorded on the silence |
fn expire-silence(id: string)
Expire a silence by id. Reads it first; an already-expired silence is left alone.
| Argument | Type | Description |
|---|---|---|
| id | string | Silence id |
Resources
alerts(infinite)— Alerts matching the query, with per-state counts
groups(infinite)— Alerts grouped by the routing tree's group_by labels
silences(infinite)— Silences in the requested state
status(infinite)— Server version, uptime and cluster state; the config is recorded as a SHA-256 only, never as text
silence(infinite)— Outcome of a create-silence or expire-silence call
04Previous Versions
2026.10.15.9MIT
2026.10.15.9
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.8MIT
2026.10.15.8
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.6MIT
2026.10.15.6
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.5MIT
2026.10.15.5
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.4MIT
2026.10.15.4
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.3MIT
2026.10.15.3
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.2MIT
2026.10.15.2
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.1MIT
2026.10.15.1
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.14.2MIT(was none)
2026.10.14.2
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.13.1
2026.10.13.1
First release.
alerts,groups,silences,statusread the Alertmanager v2 API.create-silencereuses or extends a matching silence instead of creating a duplicate.expire-silencereads the silence before it deletes it.statusstores a SHA-256 of the running config, never the config text.- Matcher parsing accepts
=,!=,=~,!~, quoted values containing commas, and amtool-style{...}braces. It rejects invalid label names and invalid regexes before any request is sent. - Silence ids are validated before they are used in a URL path, including ids returned by the server.
05Stats
A
100 / 100
Downloads
23
Archive size
14.6 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned
Repository
https://github.com/umag/swamp-workspace06Platforms
07Labels