Ресурс

Alert Grouping Rule

Configure rules for automatically grouping related alerts into episodes

Модель Alert Grouping Rule

Свойства

  • Имя
    _id
    Тип
    Object ID
    Описание

    ID of this object

  • Имя
    createdAt
    Тип
    Date
    Описание

    Date and Time when the object was created.

  • Имя
    updatedAt
    Тип
    Date
    Описание

    Date and Time when the object was updated.

  • Имя
    project
    Тип
    Project
    Описание

    Relation to Project Resource in which this object belongs

  • Имя
    projectId
    Тип
    Object IDОбязательно
    Описание

    ID of your Project in which this object belongs

  • Имя
    name
    Тип
    TextОбязательно
    Описание

    Name of this alert grouping rule

  • Имя
    description
    Тип
    Long Text
    Описание

    Description of this alert grouping rule

  • Имя
    priority
    Тип
    NumberОбязательно
    Описание

    Priority of this rule. Lower number = higher priority. Rules are evaluated in priority order.

  • Имя
    isEnabled
    Тип
    BooleanОбязательно
    Описание

    Whether this rule is enabled

  • Имя
    matchCriteria
    Тип
    JSON
    Описание

    JSON object defining the criteria for matching alerts to this rule

  • Имя
    monitors
    Тип
    Monitor
    Описание

    Only group alerts from these monitors. Leave empty to match alerts from any monitor.

  • Имя
    alertSeverities
    Тип
    Alert Severity
    Описание

    Only group alerts with these severities. Leave empty to match alerts of any severity.

  • Имя
    alertLabels
    Тип
    Label
    Описание

    Only group alerts that have at least one of these labels. Leave empty to match alerts regardless of alert labels.

  • Имя
    monitorLabels
    Тип
    Label
    Описание

    Only group alerts from monitors that have at least one of these labels. Leave empty to match alerts regardless of monitor labels.

  • Имя
    alertTitlePattern
    Тип
    Long Text
    Описание

    Regular expression pattern to match alert titles. Leave empty to match any title. Example: 'CPU.*high' matches titles containing 'CPU' followed by 'high'.

  • Имя
    alertDescriptionPattern
    Тип
    Long Text
    Описание

    Regular expression pattern to match alert descriptions. Leave empty to match any description.

  • Имя
    monitorNamePattern
    Тип
    Long Text
    Описание

    Regular expression pattern to match monitor names. Leave empty to match any monitor name. Example: 'prod-.*' matches monitors starting with 'prod-'.

  • Имя
    monitorDescriptionPattern
    Тип
    Long Text
    Описание

    Regular expression pattern to match monitor descriptions. Leave empty to match any monitor description.

  • Имя
    groupByMonitor
    Тип
    Boolean
    Описание

    When enabled, alerts from different monitors will be grouped into separate episodes. When disabled, alerts from any monitor can be grouped together.

  • Имя
    groupBySeverity
    Тип
    Boolean
    Описание

    When enabled, alerts with different severities will be grouped into separate episodes. When disabled, alerts of any severity can be grouped together.

  • Имя
    groupByAlertTitle
    Тип
    Boolean
    Описание

    When enabled, alerts with different titles will be grouped into separate episodes. When disabled, alerts with any title can be grouped together.

  • Имя
    groupByService
    Тип
    Boolean
    Описание

    When enabled, alerts from monitors belonging to different services will be grouped into separate episodes. When disabled, alerts can be grouped together regardless of which service the monitor belongs to.

  • Имя
    enableTimeWindow
    Тип
    Boolean
    Описание

    Enable time-based grouping. When enabled, alerts are grouped within the specified time window. When disabled, all matching alerts are grouped into a single ongoing episode regardless of time.

  • Имя
    timeWindowMinutes
    Тип
    Number
    Описание

    Rolling time window in minutes. Alerts are grouped if they arrive within this gap from the last alert.

  • Имя
    groupByFields
    Тип
    JSON
    Описание

    JSON object defining the fields to group alerts by (e.g., monitorId, severity)

  • Имя
    episodeTitleTemplate
    Тип
    Long Text
    Описание

    Template for generating episode titles. Supports placeholders like {{alertSeverity}}, {{monitorName}}, {{alertTitle}}, {{alertDescription}}

  • Имя
    episodeDescriptionTemplate
    Тип
    Long Text
    Описание

    Template for generating episode descriptions. Supports placeholders like {{alertSeverity}}, {{monitorName}}, {{alertTitle}}, {{alertDescription}}

  • Имя
    enableResolveDelay
    Тип
    Boolean
    Описание

    Enable grace period before auto-resolving episode after all alerts resolve. Helps prevent rapid state changes during alert flapping.

  • Имя
    resolveDelayMinutes
    Тип
    Number
    Описание

    Grace period in minutes before auto-resolving an episode after all alerts are resolved

  • Имя
    enableReopenWindow
    Тип
    Boolean
    Описание

    Enable reopening recently resolved episodes instead of creating new ones. Useful when related issues recur shortly after resolution.

  • Имя
    reopenWindowMinutes
    Тип
    Number
    Описание

    Time window in minutes to reopen a recently resolved episode instead of creating a new one

  • Имя
    enableInactivityTimeout
    Тип
    Boolean
    Описание

    Enable auto-resolving episodes after a period of inactivity. Helps automatically close episodes when no new alerts arrive.

  • Имя
    inactivityTimeoutMinutes
    Тип
    Number
    Описание

    Time in minutes after which an inactive episode will be auto-resolved

  • Имя
    onCallDutyPolicies
    Тип
    On-Call Policy
    Описание

    List of on-call duty policies to execute for episodes created by this rule.

  • Имя
    defaultAssignToUser
    Тип
    User
    Описание

    Default user to assign episodes created by this rule

  • Имя
    defaultAssignToUserId
    Тип
    Object ID
    Описание

    Default User ID to assign episodes created by this rule

  • Имя
    defaultAssignToTeam
    Тип
    Team
    Описание

    Default team to assign episodes created by this rule

  • Имя
    defaultAssignToTeamId
    Тип
    Object ID
    Описание

    Default Team ID to assign episodes created by this rule

  • Имя
    episodeLabels
    Тип
    Label
    Описание

    Labels to automatically apply to episodes created by this rule.

  • Имя
    episodeOwnerUsers
    Тип
    User
    Описание

    Users to automatically add as owners to episodes created by this rule.

  • Имя
    episodeOwnerTeams
    Тип
    Team
    Описание

    Teams to automatically add as owners to episodes created by this rule.

  • Имя
    createdByUser
    Тип
    User
    Описание

    Relation to User who created this object (if this object was created by a User)

  • Имя
    createdByUserId
    Тип
    Object ID
    Описание

    User ID who created this object (if this object was created by a User)

GETorPOST/api/alert-grouping-rule/get-list

Список

Этот метод возвращает постраничный список ваших объектов «Alert Grouping Rule». По умолчанию на странице до десяти записей.

Необязательные query-параметры

  • limit
    число
    Сколько объектов вернуть. По умолчанию 10, максимум 100
  • skip
    число
    Сколько объектов пропустить (для пагинации)

Необязательное тело запроса

Запрос списка

POST
/api/alert-grouping-rule/get-list?skip=0&limit=10
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "isEnabled": true,
    "name": true,
    "priority": true,
    "projectId": true,
    "_id": true
  },
  "query": {
    "name": "Example name"
  },
  "sort": {
    "createdAt": -1
  }
}

Ответ

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "376c6190-28fe-11f1-b591-3fdcef396aba",
      "isEnabled": true,
      "name": "Example name",
      "priority": 100,
      "projectId": "550e8400-e29b-41d4-a716-446655440000"
    },
    {
      "_id": "376c6191-28fe-11f1-b591-3fdcef396aba",
      "isEnabled": true,
      "name": "Example name",
      "priority": 100,
      "projectId": "550e8400-e29b-41d4-a716-446655440000"
    },
    {
      "_id": "376c6192-28fe-11f1-b591-3fdcef396aba",
      "isEnabled": true,
      "name": "Example name",
      "priority": 100,
      "projectId": "550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}
GETorPOST/api/alert-grouping-rule/:id/get-item

Получить по ID

Возвращает объект «Alert Grouping Rule» по идентификатору.

  • id
    строка
    ID объекта

Необязательное тело запроса

  • select
    По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.

Запрос одного объекта

POST
/api/alert-grouping-rule/:id/get-item
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "isEnabled": true,
    "name": true,
    "priority": true,
    "projectId": true,
    "_id": true
  }
}

Ответ

{
  "_id": "550e8400-e29b-41d4-a716-446655440000",
  "isEnabled": true,
  "name": "Example name",
  "priority": 100,
  "projectId": "550e8400-e29b-41d4-a716-446655440000"
}
POST/api/alert-grouping-rule/count

Количество

Возвращает количество ваших объектов «Alert Grouping Rule».

Необязательное тело запроса

Запрос количества

POST
/api/alert-grouping-rule/count
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "query": {
    "name": "Example name"
  }
}

Ответ

{
  "count": 107
}
POST/api/alert-grouping-rule

Создать Alert Grouping Rule

Создаёт новый объект.

Запрос создания

POST
/api/alert-grouping-rule
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "isEnabled": true,
    "name": "Example name",
    "priority": 100,
    "projectId": "550e8400-e29b-41d4-a716-446655440000",
    "alertDescriptionPattern": "Example alert description pattern"
  }
}

Ответ

{
  "_id": "550e8400-e29b-41d4-a716-446655440000",
  "isEnabled": true,
  "name": "Example name",
  "priority": 100,
  "projectId": "550e8400-e29b-41d4-a716-446655440000"
}
PUT/api/alert-grouping-rule/:id

Обновить по ID

Обновляет объект по ID.

Альтернативные методы

Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:

POST/api/alert-grouping-rule/:id/update-item
GET/api/alert-grouping-rule/:id/update-item

Запрос обновления

PUT
/api/alert-grouping-rule/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "isEnabled": true,
    "name": "Example name",
    "priority": 100
  }
}

Ответ

{}
DELETE/api/alert-grouping-rule/:id

Удалить по ID

Удаляет объект по ID.

Альтернативные методы

Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:

POST/api/alert-grouping-rule/:id/delete-item
GET/api/alert-grouping-rule/:id/delete-item

Запрос удаления

DELETE
/api/alert-grouping-rule/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY

Ответ

{}

Права доступа

Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.

Права на чтение

Нужны для чтения Alert Grouping Rule

  • Project Owner
  • Project Admin
  • Project Member
  • Read Alert Grouping Rule
  • Read All Project Resources

Права на создание

Нужны для создания Alert Grouping Rule

  • Project Owner
  • Project Admin
  • Create Alert Grouping Rule

Права на обновление

Нужны для обновления Alert Grouping Rule

  • Project Owner
  • Project Admin
  • Edit Alert Grouping Rule

Права на удаление

Нужны для удаления Alert Grouping Rule

  • Project Owner
  • Project Admin
  • Delete Alert Grouping Rule