Skip to main content

Alertmanager

@magistr/alertmanagerv2026.10.25.10· MIT· 6d agoBEHAVIORS
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), and expire-silence (reads first; an already-expired silence is left alone).
02Release Notes

2026.10.25.10

  • Repo-wide republish; no functional change.
03Behaviors1
@magistr/alertmanagerv2026.10.25.10extensions/models/alertmanager.ts

Global Arguments

ArgumentTypeDescription
urlstringAlertmanager base URL, e.g. http://alertmanager.example:9093
timeoutMs?numberPer-request timeout in milliseconds
fn alerts(unprocessed?: boolean)
List alerts. Defaults to active, not silenced, not inhibited — the alerts that are notifying now.
ArgumentTypeDescription
unprocessed?booleanInclude 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
ArgumentTypeDescription
state?enumSilence state to keep
filter?stringLabel 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.
ArgumentTypeDescription
matchersstringLabel matchers, comma-separated: alertname="X",instance="y"
durationMinutes?numberHow long the silence lasts, from now
commentstringWhy the alerts are silenced
createdBy?stringAuthor recorded on the silence
fn expire-silence(id: string)
Expire a silence by id. Reads it first; an already-expired silence is left alone.
ArgumentTypeDescription
idstringSilence 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 Versions10
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, status read the Alertmanager v2 API.
  • create-silence reuses or extends a matching silence instead of creating a duplicate. expire-silence reads the silence before it deletes it.
  • status stores 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
06Platforms
07Labels