Back to Nightingale

Alert mutes (silences)

aiagent/skill/embedded/builtin/skill-creator/api/alert-mutes.md

9.1.15.2 KB
Original Source

Alert mutes (silences)

Alert mutes (a.k.a. silences) suppress alert notifications for events whose tags match the mute's matchers, during a configured time window. The window is either a one-off time range (mute_time_type=0, using btime/etime) or a recurring weekly schedule (mute_time_type=1, using periodic_mutes). Use these read endpoints to list existing mutes.

Gateway call: GET. Include the /api/n9e prefix in path. Response {"ok":true,"status":200,"data":{"dat":<payload>,"err":""}} — read data["dat"]. Protocol: see ../n9e-api.md.

Endpoints

PathPurposedat shape
/busi-groups/alert-mutesMutes across all business groups you can read (optionally narrowed by gids)Pattern B: bare array of AlertMute
/busi-group/:id/alert-mutesMutes of one business group (:id in the path)Pattern B: bare array of AlertMute

Query parameters

ParamTypeRequiredDefaultMeaningEndpoint
gidsstring (comma-separated ints)Noall groups you can readRestrict to these business group IDs. Empty = all groups you have read access to (admins = all groups)./busi-groups/alert-mutes
prodsstring (space-separated)NoallKeep only mutes whose prod is in this list, e.g. metric anomaly loki./busi-group/:id/alert-mutes
querystringNo(none)Case-insensitive substring filter on the cause field. Multiple space-separated words are AND-ed (every word must match)./busi-group/:id/alert-mutes
expiredintNo-1Time-window filter. -1 = all mutes (no filter). 1 = only expired mutes: time-range mutes (mute_time_type=0) whose etime < now. 0 (or any value other than -1/1) = only non-expired mutes: time-range mutes with etime >= now plus all periodic mutes (mute_time_type=1)./busi-group/:id/alert-mutes

Response — dat payload

(Pattern B bare array.) Each mute is an AlertMute:

Field (json)TypeMeaning
idint64Mute rule ID.
group_idint64Business group ID this mute belongs to.
notestringFree-text note/description.
catestringCategory/classification of the mute.
prodstringProduct / monitoring type the mute applies to (e.g. metric, anomaly, loki).
datasource_ids[]int64 (computed)Datasource IDs this mute is scoped to. A single element [0] means "all datasources".
clusterstringEffective clusters, separated by spaces.
tagsarray of TagFilterTag matchers — an alert is muted only if its tags satisfy every matcher (see TagFilter below).
causestringReason for creating the mute.
btimeint64Begin time, Unix seconds (used when mute_time_type=0).
etimeint64End time, Unix seconds (used when mute_time_type=0).
disabledint0 = enabled, 1 = disabled.
activatedint (computed)Whether the mute is in effect right now: 1 = currently within its mute window, 0 = not.
create_bystringUsername of the creator.
update_bystringUsername of the last updater.
update_by_nicknamestring (computed)Display nickname of the last updater.
create_atint64Creation time, Unix seconds.
update_atint64Last update time, Unix seconds.
mute_time_typeintWindow kind: 0 = one-off time range (btime/etime), 1 = periodic weekly schedule (periodic_mutes).
periodic_mutesarray (computed)Recurring schedule entries (used when mute_time_type=1). Each has enable_stime, enable_etime (space-separated HH:MM lists) and enable_days_of_week (e.g. "0 1 2 3 4 5 6").
severities[]int (computed)Alert severity levels this mute applies to (e.g. 1,2,3). Empty = all severities.

TagFilter (each item in the mute's tags matchers)

Field (json)TypeMeaning
keystringTag key to match against.
funcstringMatch operator: ==, !=, =~, !~, in, or not in. (If empty, the server falls back to op.)
opstringLegacy alias of func, same allowed operators; usually empty when func is set.
valueanyTag value to compare. A string for ==/!=/=~/!~; for in/not in it is a space-separated string or an array of values.

Example

Request:

json
{"method":"GET","path":"/api/n9e/busi-groups/alert-mutes","query":{}}

Response (trimmed):

json
{
  "ok": true,
  "status": 200,
  "data": {
    "dat": [
      {
        "id": 12,
        "group_id": 4,
        "note": "silence disk alerts during maintenance",
        "cate": "",
        "prod": "metric",
        "datasource_ids": [0],
        "cluster": "",
        "tags": [
          {"key": "rulename", "func": "==", "op": "", "value": "disk_full"}
        ],
        "cause": "planned maintenance",
        "btime": 1719800000,
        "etime": 1719810000,
        "disabled": 0,
        "activated": 1,
        "create_by": "root",
        "update_by": "root",
        "update_by_nickname": "Administrator",
        "create_at": 1719799000,
        "update_at": 1719799000,
        "mute_time_type": 0,
        "periodic_mutes": [],
        "severities": [1, 2, 3]
      }
    ],
    "err": ""
  }
}