|
1502 | 1502 | "On-call/Incidents" |
1503 | 1503 | ], |
1504 | 1504 | "x-mint": { |
1505 | | - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", |
| 1505 | + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |\n\n## Usage\n\n- Set `include_events=true` only when you need a preview of each alert's raw events.\n- Event previews are capped at the 20 newest events per alert. Use `POST /alert/event/list` for a full paginated event history.\n- `event_cnt` still reports the total number of raw events merged into each alert.", |
1506 | 1506 | "href": "/en/api-reference/on-call/incidents/incident-alert-list", |
1507 | 1507 | "metadata": { |
1508 | 1508 | "sidebarTitle": "List alerts of incident" |
|
1571 | 1571 | "images": null, |
1572 | 1572 | "data_source_name": "FlashMonit", |
1573 | 1573 | "data_source_type": "monit.alert", |
1574 | | - "data_source_ref_id": "a_2451002751131" |
| 1574 | + "data_source_ref_id": "a_2451002751131", |
| 1575 | + "events": [ |
| 1576 | + { |
| 1577 | + "event_id": "69da451df77b1b51f40e83df", |
| 1578 | + "alert_id": "69da451df77b1b51f40e83de", |
| 1579 | + "title": "CPU usage > 90%", |
| 1580 | + "event_severity": "Critical", |
| 1581 | + "event_status": "Critical", |
| 1582 | + "event_time": 1712650000, |
| 1583 | + "labels": { |
| 1584 | + "host": "web-01" |
| 1585 | + } |
| 1586 | + } |
| 1587 | + ] |
1575 | 1588 | } |
1576 | 1589 | ] |
1577 | 1590 | } |
|
1603 | 1616 | "incident_id": "69da451ef77b1b51f40e83ee", |
1604 | 1617 | "is_active": true, |
1605 | 1618 | "limit": 100, |
1606 | | - "p": 1 |
| 1619 | + "p": 1, |
| 1620 | + "include_events": true |
1607 | 1621 | } |
1608 | 1622 | } |
1609 | 1623 | } |
|
1999 | 2013 | "post": { |
2000 | 2014 | "operationId": "alert-read-event-list", |
2001 | 2015 | "summary": "List events for an alert", |
2002 | | - "description": "Return all raw events that have been ingested into a specific alert, in chronological order.", |
| 2016 | + "description": "Return raw events for an alert with cursor or page-number pagination.", |
2003 | 2017 | "tags": [ |
2004 | 2018 | "On-call/Alerts" |
2005 | 2019 | ], |
2006 | 2020 | "x-mint": { |
2007 | | - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Each alert accumulates raw events from the integration. This endpoint exposes the raw event history for a given alert.", |
| 2021 | + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Results are newest-first by default. Set `asc=true` to read events oldest-first.\n- Use `limit` with `search_after_ctx` from the previous response to fetch the next page.\n- Classic page-number pagination is also supported with `p`, but `p * limit` must stay within 10,000 records.\n- Each alert can accumulate a large raw event history; prefer cursor pagination for hot alerts.", |
2008 | 2022 | "href": "/en/api-reference/on-call/alerts/alert-read-event-list", |
2009 | 2023 | "metadata": { |
2010 | 2024 | "sidebarTitle": "List events for an alert" |
|
2033 | 2047 | "example": { |
2034 | 2048 | "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", |
2035 | 2049 | "data": { |
| 2050 | + "total": 57, |
| 2051 | + "has_next_page": true, |
| 2052 | + "search_after_ctx": "663a1b2c3d4e5f6789abc001", |
2036 | 2053 | "items": [ |
2037 | 2054 | { |
2038 | 2055 | "event_id": "663a1b2c3d4e5f6789abc001", |
|
2072 | 2089 | "$ref": "#/components/schemas/AlertEventListRequest" |
2073 | 2090 | }, |
2074 | 2091 | "example": { |
2075 | | - "alert_id": "663a1b2c3d4e5f6789abcdef" |
| 2092 | + "alert_id": "663a1b2c3d4e5f6789abcdef", |
| 2093 | + "limit": 20 |
2076 | 2094 | } |
2077 | 2095 | } |
2078 | 2096 | } |
@@ -16249,18 +16267,63 @@ |
16249 | 16267 | "properties": { |
16250 | 16268 | "alert_id": { |
16251 | 16269 | "type": "string", |
16252 | | - "description": "Alert ID (ObjectID hex string)." |
| 16270 | + "pattern": "^[0-9a-fA-F]{24}$", |
| 16271 | + "description": "Alert ID (MongoDB ObjectID)." |
| 16272 | + }, |
| 16273 | + "asc": { |
| 16274 | + "type": "boolean", |
| 16275 | + "default": false, |
| 16276 | + "description": "When true, return events oldest-first. Defaults to newest-first." |
| 16277 | + }, |
| 16278 | + "limit": { |
| 16279 | + "type": "integer", |
| 16280 | + "format": "int64", |
| 16281 | + "minimum": 0, |
| 16282 | + "maximum": 100, |
| 16283 | + "default": 20, |
| 16284 | + "description": "Page size. Defaults to 20 and cannot exceed 100." |
| 16285 | + }, |
| 16286 | + "p": { |
| 16287 | + "type": "integer", |
| 16288 | + "format": "int64", |
| 16289 | + "minimum": 0, |
| 16290 | + "default": 1, |
| 16291 | + "description": "Page number starting at 1. Used when `search_after_ctx` is omitted." |
| 16292 | + }, |
| 16293 | + "search_after_ctx": { |
| 16294 | + "type": "string", |
| 16295 | + "pattern": "^[0-9a-fA-F]{24}$", |
| 16296 | + "description": "Cursor returned by the previous page. When supplied, cursor pagination is used instead of page-number pagination." |
16253 | 16297 | } |
16254 | 16298 | } |
16255 | 16299 | }, |
16256 | 16300 | "AlertEventListResponse": { |
16257 | 16301 | "type": "object", |
| 16302 | + "required": [ |
| 16303 | + "items", |
| 16304 | + "total", |
| 16305 | + "has_next_page" |
| 16306 | + ], |
16258 | 16307 | "properties": { |
16259 | 16308 | "items": { |
16260 | 16309 | "type": "array", |
16261 | 16310 | "items": { |
16262 | 16311 | "$ref": "#/components/schemas/AlertEventItem" |
16263 | | - } |
| 16312 | + }, |
| 16313 | + "description": "Raw alert events in the requested order." |
| 16314 | + }, |
| 16315 | + "total": { |
| 16316 | + "type": "integer", |
| 16317 | + "format": "int64", |
| 16318 | + "description": "Total matching event count." |
| 16319 | + }, |
| 16320 | + "has_next_page": { |
| 16321 | + "type": "boolean", |
| 16322 | + "description": "Whether another page is available." |
| 16323 | + }, |
| 16324 | + "search_after_ctx": { |
| 16325 | + "type": "string", |
| 16326 | + "description": "Cursor to pass as `search_after_ctx` for the next page." |
16264 | 16327 | } |
16265 | 16328 | } |
16266 | 16329 | }, |
|
16516 | 16579 | "items": { |
16517 | 16580 | "$ref": "#/components/schemas/AlertEventItem" |
16518 | 16581 | }, |
16519 | | - "description": "Raw alert events, populated when the caller opts in." |
| 16582 | + "description": "Raw alert event preview, populated only when requested. Capped at the 20 newest events per alert." |
16520 | 16583 | }, |
16521 | 16584 | "event_cnt": { |
16522 | 16585 | "type": "integer", |
|
22369 | 22432 | }, |
22370 | 22433 | "include_events": { |
22371 | 22434 | "type": "boolean", |
22372 | | - "description": "When true, include raw alert events in each alert item." |
| 22435 | + "description": "When true, include at most the 20 newest raw events in each alert item as a preview." |
22373 | 22436 | }, |
22374 | 22437 | "is_active": { |
22375 | 22438 | "type": [ |
|
0 commit comments