Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Backport This will backport the following commits from `main` to `8.14`: - [Onboard Uptime rule types with FAAD (#179493)](#179493) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ersin Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-05-02T15:53:56Z","message":"Onboard Uptime rule types with FAAD (#179493)\n\nTowards: https://github.com/elastic/kibana/issues/169867\r\n\r\nThis PR onboards Uptime rule types (Tls, Duration Anolamy and Monitor\r\nstatus) with FAAD.\r\n\r\nWe are deprecating the rule-registry plugin and onboard the rule types\r\nwith the new alertsClient to manage alert-as-data.\r\nThere is no new future, all the rule types should work as they were, and\r\nsave alerts with all the existing fields.\r\n\r\n## To verify:\r\n\r\n- Switch to Kibana 8.9.0 in your local repo. (In this version Uptime\r\nrules are not deprecated)\r\n- Run your ES with: `yarn es snapshot -E path.data=../local-es-data`\r\n- Run your Kibana\r\n- Create Uptime rules with an active and a recovered action (You can run\r\nHeartbeat locally if needed, [follow the\r\ninstructions](https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-installation-configuration.html))\r\n- Stop your ES and Kibana\r\n- Switch to this branch and run your ES with `yarn es snapshot -E\r\npath.data=../local-es-data` again.\r\n- Run your Kibana\r\n- Modify Uptime rulesType codes to force them to create an alert.\r\nExample:\r\nMock [availabilityResults in\r\nstatus_check](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/status_check.ts#L491)\r\nwith below data\r\n```\r\navailabilityResults = [\r\n {\r\n monitorId: '1',\r\n up: 1,\r\n down: 0,\r\n location: 'location',\r\n availabilityRatio: 0.5,\r\n monitorInfo: {\r\n timestamp: '',\r\n monitor: {\r\n id: '1',\r\n status: 'down',\r\n type: 'type',\r\n check_group: 'default',\r\n },\r\n docId: 'docid',\r\n },\r\n },\r\n ];\r\n```\r\n\r\nIt should create an alert. The alert should be saved under\r\n`.alerts-observability.uptime.alerts` index and be visible under\r\nobservability alerts page.\r\n\r\nThen remove the mock, the alert should be recovered.","sha":"d228f488ec0456c96b3e06aee57a0d28af851eb4","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","ci:project-deploy-observability","apm:review","v8.14.0","v8.15.0"],"title":"Onboard Uptime rule types with FAAD","number":179493,"url":"https://github.com/elastic/kibana/pull/179493","mergeCommit":{"message":"Onboard Uptime rule types with FAAD (#179493)\n\nTowards: https://github.com/elastic/kibana/issues/169867\r\n\r\nThis PR onboards Uptime rule types (Tls, Duration Anolamy and Monitor\r\nstatus) with FAAD.\r\n\r\nWe are deprecating the rule-registry plugin and onboard the rule types\r\nwith the new alertsClient to manage alert-as-data.\r\nThere is no new future, all the rule types should work as they were, and\r\nsave alerts with all the existing fields.\r\n\r\n## To verify:\r\n\r\n- Switch to Kibana 8.9.0 in your local repo. (In this version Uptime\r\nrules are not deprecated)\r\n- Run your ES with: `yarn es snapshot -E path.data=../local-es-data`\r\n- Run your Kibana\r\n- Create Uptime rules with an active and a recovered action (You can run\r\nHeartbeat locally if needed, [follow the\r\ninstructions](https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-installation-configuration.html))\r\n- Stop your ES and Kibana\r\n- Switch to this branch and run your ES with `yarn es snapshot -E\r\npath.data=../local-es-data` again.\r\n- Run your Kibana\r\n- Modify Uptime rulesType codes to force them to create an alert.\r\nExample:\r\nMock [availabilityResults in\r\nstatus_check](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/status_check.ts#L491)\r\nwith below data\r\n```\r\navailabilityResults = [\r\n {\r\n monitorId: '1',\r\n up: 1,\r\n down: 0,\r\n location: 'location',\r\n availabilityRatio: 0.5,\r\n monitorInfo: {\r\n timestamp: '',\r\n monitor: {\r\n id: '1',\r\n status: 'down',\r\n type: 'type',\r\n check_group: 'default',\r\n },\r\n docId: 'docid',\r\n },\r\n },\r\n ];\r\n```\r\n\r\nIt should create an alert. The alert should be saved under\r\n`.alerts-observability.uptime.alerts` index and be visible under\r\nobservability alerts page.\r\n\r\nThen remove the mock, the alert should be recovered.","sha":"d228f488ec0456c96b3e06aee57a0d28af851eb4"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/179493","number":179493,"mergeCommit":{"message":"Onboard Uptime rule types with FAAD (#179493)\n\nTowards: https://github.com/elastic/kibana/issues/169867\r\n\r\nThis PR onboards Uptime rule types (Tls, Duration Anolamy and Monitor\r\nstatus) with FAAD.\r\n\r\nWe are deprecating the rule-registry plugin and onboard the rule types\r\nwith the new alertsClient to manage alert-as-data.\r\nThere is no new future, all the rule types should work as they were, and\r\nsave alerts with all the existing fields.\r\n\r\n## To verify:\r\n\r\n- Switch to Kibana 8.9.0 in your local repo. (In this version Uptime\r\nrules are not deprecated)\r\n- Run your ES with: `yarn es snapshot -E path.data=../local-es-data`\r\n- Run your Kibana\r\n- Create Uptime rules with an active and a recovered action (You can run\r\nHeartbeat locally if needed, [follow the\r\ninstructions](https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-installation-configuration.html))\r\n- Stop your ES and Kibana\r\n- Switch to this branch and run your ES with `yarn es snapshot -E\r\npath.data=../local-es-data` again.\r\n- Run your Kibana\r\n- Modify Uptime rulesType codes to force them to create an alert.\r\nExample:\r\nMock [availabilityResults in\r\nstatus_check](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/status_check.ts#L491)\r\nwith below data\r\n```\r\navailabilityResults = [\r\n {\r\n monitorId: '1',\r\n up: 1,\r\n down: 0,\r\n location: 'location',\r\n availabilityRatio: 0.5,\r\n monitorInfo: {\r\n timestamp: '',\r\n monitor: {\r\n id: '1',\r\n status: 'down',\r\n type: 'type',\r\n check_group: 'default',\r\n },\r\n docId: 'docid',\r\n },\r\n },\r\n ];\r\n```\r\n\r\nIt should create an alert. The alert should be saved under\r\n`.alerts-observability.uptime.alerts` index and be visible under\r\nobservability alerts page.\r\n\r\nThen remove the mock, the alert should be recovered.","sha":"d228f488ec0456c96b3e06aee57a0d28af851eb4"}}]}] BACKPORT--> Co-authored-by: Ersin Erdal <92688503+ersin-erdal@users.noreply.github.com>
- Loading branch information