Alertmanager
Read Prometheus Alertmanager alerts, fire alerts from rows and manage silences. Typical uses: raise an alert from a job, silence alerts during maintenance.
alertmanager pingalertmanager statusalertmanager receiversalertmanager alert_postalertmanager alert_postalertmanager alertsalertmanager alertsalertmanager silence_createalertmanager silencesalertmanager silencesalertmanager silence_deletealertmanager requestalertmanager request

alertmanager ping <config>


Description

    Test the connection. Returns {ok, version, cluster, uptime}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
alertmanager ping "{\"url\": \"http://127.0.0.1:9093\"}"
mentdb
{"ok": true, "version": "0.35.0", "cluster": "disabled", "uptime": "2026-11-17T20:07:16.048+04:00"}

alertmanager status <config>


Description

    The status: cluster, configuration (YAML text, secrets hidden by Alertmanager), uptime, version information

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
alertmanager status "{\"url\": \"http://127.0.0.1:9093\"}"
mentdb
{"cluster": {"peers": [], "status": "disabled"}, "config": {"original": "global:\ resolve_timeout: 5m\ http_config:\ follow_redirects: true\ enable_http2: true\ smtp_hello: localhost\ smtp_require_tls: true\ smtp_tls_config:\ insecure_skip_verify: false\ slack_app_url: https://slack.com/api/chat.postMessage\ pagerduty_url: https://events.pagerduty.com/v2/enqueue\ opsgenie_api_url: https://api.opsgenie.com/\ wechat_api_url: https://qyapi.weixin.qq.com/cgi-bin/\ victorops_api_url: https://alert.victorops.com/integrations/generic/20131114/alert/\ telegram_api_url: https://api.telegram.org\ webex_api_url: https://webexapis.com/v1/messages\ rocketchat_api_url: https://open.rocket.chat/\ route:\ receiver: \"null\"\ continue: false\ group_wait: 1s\ receivers:\ - name: \"null\"\ labels:\ name: \"null\"\ templates: []\ "}, "uptime": "2026-11-17T20:07:16.048+04:00", "versionInfo": {"branch": "HEAD", "buildDate": "20261109-16:46:40", "buildUser": "root@57960a2b4b4b", "goVersion": "go1.27.3", "revision": "8cf67a8e75004bad6c3c6bacc829945cf8a3ee65", "version": "0.35.0"}}

alertmanager receivers <config>


Description

    The names of the receivers. Returns a JSON array

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
alertmanager receivers "{\"url\": \"http://127.0.0.1:9093\"}"
mentdb
["null"]

alertmanager alert_post <config> <rows_json>


Description

    Fire (or resolve) alerts from rows. Returns {posted}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    rows_json:   The alerts: a JSON array of objects (or one object) - String - required
admin
alertmanager alert_post "{\"url\": \"http://127.0.0.1:9093\"}" "[{\"labels\": {\"alertname\": \"DiskFull\", \"host\": \"db1\", \"severity\": \"warning\"}, \"annotations\": {\"summary\": \"Disk at 95%\"}, \"generator_url\": \"https://mentdb.example.com/jobs/42\"}]"
mentdb
{"posted": 1}
No alertname
admin
alertmanager alert_post "{\"url\": \"http://127.0.0.1:9093\"}" "[{\"severity\": \"critical\"}]"
mentdb
ERROR: Sorry, an error appears (the alert 0 needs the label 'alertname').

alertmanager alert_post <config> <rows_json> <options_json>


Description

    Fire alerts with options: labels (labels added to every alert), annotations (added to every alert), annotation_fields (the fields of flat rows that are annotations), generator_url, duration (the alerts end after it, from their start)

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    rows_json:   The alerts - String - required
    options_json:   The options - String - required
admin
alertmanager alert_post "{\"url\": \"http://127.0.0.1:9093\"}" "[{\"alertname\": \"ImportFailed\", \"severity\": \"critical\", \"job\": \"nightly_import\", \"summary\": \"3 rows rejected\"}]" "{\"annotation_fields\": [\"summary\"], \"duration\": \"1h\", \"labels\": {\"team\": \"data\"}}"
mentdb
{"posted": 1}

alertmanager alerts <config>


Description

    The alerts. Returns rows {alertname, state, starts_at, ends_at, updated_at, fingerprint, receivers, silenced_by, inhibited_by, generator_url, labels, annotations}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
alertmanager alerts "{\"url\": \"http://127.0.0.1:9093\"}"
mentdb
[{"alertname": "DiskFull", "state": "active", "starts_at": "2026-11-17T16:08:31.588Z", "ends_at": "2026-11-17T16:13:31.588Z", "updated_at": "2026-11-17T16:08:31.588Z", "fingerprint": "134a53746f384282", "receivers": ["null"], "silenced_by": [], "inhibited_by": [], "generator_url": "https://mentdb.example.com/jobs/42", "labels": {"alertname": "DiskFull", "host": "db1", "severity": "warning"}, "annotations": {"summary": "Disk at 95%"}}, {"alertname": "AlwaysFiring", "state": "active", "starts_at": "2026-11-17T15:50:00.270Z", "ends_at": "2026-11-17T16:12:25.270Z", "updated_at": "2026-11-17T16:08:25.314Z", "fingerprint": "32a2ddd10fadf757", "receivers": ["null"], "silenced_by": [], "inhibited_by": [], "generator_url": "http://prometheus-host:9090/graph?g0.expr=vector%281%29&g0.tab=1", "labels": {"alertname": "AlwaysFiring", "severity": "info"}, "annotations": {"summary": "Test alert that always fires"}}, {"alertname": "ImportFailed", "state": "active", "starts_at": "2026-11-17T16:08:32.480Z", "ends_at": "2026-11-17T17:08:32.480Z", "updated_at": "2026-11-17T16:08:32.508Z", "fingerprint": "cc6646855fd4b6c9", "receivers": ["null"], "silenced_by": [], "inhibited_by": [], "generator_url": null, "labels": {"alertname": "ImportFailed", "job": "nightly_import", "severity": "critical", "team": "data"}, "annotations": {"summary": "3 rows rejected"}}]

alertmanager alerts <config> <options_json>


Description

    The alerts with options: filter (a matcher or a JSON array of matchers like alertname="X"), active, silenced, inhibited, unprocessed (true or false: include them), receiver (a regular expression), time_format

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    options_json:   The options - String - required
admin
alertmanager alerts "{\"url\": \"http://127.0.0.1:9093\"}" "{\"filter\": \"alertname=\\"ImportFailed\\"\"}"
mentdb
[{"alertname": "ImportFailed", "state": "active", "starts_at": "2026-11-17T16:08:32.480Z", "ends_at": "2026-11-17T17:08:32.480Z", "updated_at": "2026-11-17T16:08:32.508Z", "fingerprint": "cc6646855fd4b6c9", "receivers": ["null"], "silenced_by": [], "inhibited_by": [], "generator_url": null, "labels": {"alertname": "ImportFailed", "job": "nightly_import", "severity": "critical", "team": "data"}, "annotations": {"summary": "3 rows rejected"}}]
without the silenced alerts (fixed result: real Alertmanager 0.35.0)
admin
alertmanager alerts "{\"url\": \"http://127.0.0.1:9093\"}" "{\"silenced\": false}"
mentdb
[{"alertname": "DiskFull", "state": "active", "starts_at": "2026-11-17T16:08:31.588Z", "ends_at": "2026-11-17T16:13:31.588Z", "updated_at": "2026-11-17T16:08:31.588Z", "fingerprint": "134a53746f384282", "receivers": ["null"], "silenced_by": [], "inhibited_by": [], "generator_url": "https://mentdb.example.com/jobs/42", "labels": {"alertname": "DiskFull", "host": "db1", "severity": "warning"}, "annotations": {"summary": "Disk at 95%"}}, {"alertname": "AlwaysFiring", "state": "active", "starts_at": "2026-11-17T15:50:00.270Z", "ends_at": "2026-11-17T16:12:25.270Z", "updated_at": "2026-11-17T16:08:25.314Z", "fingerprint": "32a2ddd10fadf757", "receivers": ["null"], "silenced_by": [], "inhibited_by": [], "generator_url": "http://prometheus-host:9090/graph?g0.expr=vector%281%29&g0.tab=1", "labels": {"alertname": "AlwaysFiring", "severity": "info"}, "annotations": {"summary": "Test alert that always fires"}}, {"alertname": "ImportFailed", "state": "active", "starts_at": "2026-11-17T16:08:32.480Z", "ends_at": "2026-11-17T17:08:32.480Z", "updated_at": "2026-11-17T16:08:32.508Z", "fingerprint": "cc6646855fd4b6c9", "receivers": ["null"], "silenced_by": [], "inhibited_by": [], "generator_url": null, "labels": {"alertname": "ImportFailed", "job": "nightly_import", "severity": "critical", "team": "data"}, "annotations": {"summary": "3 rows rejected"}}]

alertmanager silence_create <config> <silence_json>


Description

    Create a silence: {matchers, starts_at (now), ends_at or duration, created_by (mentdb), comment, id (to update an existing silence)}. Returns {id}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    silence_json:   The silence as a JSON object - String - required
admin
alertmanager silence_create "{\"url\": \"http://127.0.0.1:9093\"}" "{\"matchers\": {\"alertname\": \"ImportFailed\"}, \"duration\": \"2h\", \"comment\": \"Maintenance of the import\"}"
mentdb
{"id": "8c3a8518-6fd0-4151-869d-31f04b31bcd5"}
regular expressions and a negative matcher (fixed result: real Alertmanager 0.35.0)
admin
alertmanager silence_create "{\"url\": \"http://127.0.0.1:9093\"}" "{\"matchers\": [\"host=~\\"db.*\\"\", \"alertname!=\\"Watchdog\\"\"], \"ends_at\": \"now+30m\", \"created_by\": \"ops\", \"comment\": \"DB maintenance\"}"
mentdb
{"id": "4753dfef-5ca1-47d6-897a-48911278bbbc"}
No end
admin
alertmanager silence_create "{\"url\": \"http://127.0.0.1:9093\"}" "{\"matchers\": {\"alertname\": \"X\"}, \"comment\": \"c\"}"
mentdb
ERROR: Sorry, an error appears (the silence needs 'ends_at' or 'duration' (like 2h)).

alertmanager silences <config>


Description

    The silences. Returns rows {id, state, matchers, starts_at, ends_at, updated_at, created_by, comment}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
alertmanager silences "{\"url\": \"http://127.0.0.1:9093\"}"
mentdb
[{"id": "4753dfef-5ca1-47d6-897a-48911278bbbc", "state": "active", "matchers": ["host=~\"db.*\"", "alertname!=\"Watchdog\""], "starts_at": "2026-11-17T16:08:36.664Z", "ends_at": "2026-11-17T16:38:36.638Z", "updated_at": "2026-11-17T16:08:36.664Z", "created_by": "ops", "comment": "DB maintenance"}, {"id": "8c3a8518-6fd0-4151-869d-31f04b31bcd5", "state": "active", "matchers": ["alertname=\"ImportFailed\""], "starts_at": "2026-11-17T16:08:35.859Z", "ends_at": "2026-11-17T18:08:35.839Z", "updated_at": "2026-11-17T16:08:35.859Z", "created_by": "mentdb", "comment": "Maintenance of the import"}]

alertmanager silences <config> <options_json>


Description

    The silences with options: filter (matchers), state (active, pending, expired or any), time_format

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    options_json:   The options - String - required
admin
alertmanager silences "{\"url\": \"http://127.0.0.1:9093\"}" "{\"filter\": \"alertname=\\"ImportFailed\\"\", \"state\": \"active\"}"
mentdb
[{"id": "8c3a8518-6fd0-4151-869d-31f04b31bcd5", "state": "active", "matchers": ["alertname=\"ImportFailed\""], "starts_at": "2026-11-17T16:08:35.859Z", "ends_at": "2026-11-17T18:08:35.839Z", "updated_at": "2026-11-17T16:08:35.859Z", "created_by": "mentdb", "comment": "Maintenance of the import"}]

alertmanager silence_delete <config> <id>


Description

    Expire a silence by its id. Returns {deleted}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    id:   The id of the silence - String - required
admin
alertmanager silence_delete "{\"url\": \"http://127.0.0.1:9093\"}" "4753dfef-5ca1-47d6-897a-48911278bbbc"
mentdb
{"deleted": "4753dfef-5ca1-47d6-897a-48911278bbbc"}

alertmanager request <config> <method> <path>


Description

    Any request to the API (path under the url, like /api/v2/alerts/groups). Returns the answer text

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    method:   The HTTP method - String - required
    path:   The path - String - required
admin
alertmanager request "{\"url\": \"http://127.0.0.1:9093\"}" "GET" "/api/v2/alerts/groups?filter=alertname%3D%22DiskFull%22"
mentdb
[{"alerts":[{"annotations":{"summary":"Disk at 95%"},"endsAt":"2026-11-17T20:13:31.588+04:00","fingerprint":"134a53746f384282","receivers":[{"name":"null"}],"startsAt":"2026-11-17T20:08:31.588+04:00","status":{"inhibitedBy":[],"mutedBy":[],"silencedBy":[],"state":"active"},"updatedAt":"2026-11-17T20:08:31.588+04:00","generatorURL":"https://mentdb.example.com/jobs/42","labels":{"alertname":"DiskFull","host":"db1","severity":"warning"}}],"labels":{},"receiver":{"name":"null"},"routeLabels":{}}]

alertmanager request <config> <method> <path> <body_json>


Description

    Any request with a JSON body

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:9093; with a path prefix for Mimir: https://mimir.example.com/alertmanager), username with password (basic authentication, often a reverse proxy), or token (a bearer token), tenant (X-Scope-OrgID for Mimir and Cortex), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    method:   The HTTP method - String - required
    path:   The path - String - required
    body_json:   The JSON body - String - required
admin
alertmanager request "{\"url\": \"http://127.0.0.1:9093\"}" "POST" "/api/v2/alerts" "[{\"labels\": {\"alertname\": \"DiskFull\", \"host\": \"db1\", \"severity\": \"warning\"}, \"endsAt\": \"2026-11-17T00:00:00Z\"}]"
mentdb
{"status": 200}