Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ResponseOps][Alerts] Stack alerts page crashes on certain local storage configurations #193565

Closed
cnasikas opened this issue Sep 20, 2024 · 1 comment · Fixed by #194785
Closed
Labels
bug Fixes for quality problems that affect the customer experience Feature:Alerting/RulesManagement Issues related to the Rules Management UX Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@cnasikas
Copy link
Member

cnasikas commented Sep 20, 2024

On certain local storage configurations, the alerts page in the Stack crashes. It is unknow how to reproduce these configurations from the UI.

Image
Image

Steps to reproduce

  1. Go to DevTools and create the following rule. The rule will generate some alerts.
POST kbn:/api/alerting/rule
{
  "params": {
    "timeField": "@timestamp",
    "index": [
      ".kibana-event-log*"
    ],
    "esQuery": "{\n    \"query\":{\n      \"match_all\" : {}\n    }\n  }",
    "size": 100,
    "thresholdComparator": ">",
    "timeWindowSize": 10,
    "timeWindowUnit": "m",
    "threshold": [
      0
    ],
    "aggType": "count",
    "groupBy": "all",
    "termSize": 5,
    "searchType": "esQuery",
    "excludeHitsFromPreviousRun": false,
    "sourceFields": []
  },
  "consumer": "discover",
  "schedule": {
    "interval": "10s"
  },
  "tags": [],
  "name": "EQ rule with consumer: discover",
  "rule_type_id": ".es-query",
  "actions": []
}
  1. Add the following snippet to the stackAlerts.default.pageFilters local storage property.
Local storage snippet
{
  "viewMode": "view",
  "id": "8f6e7415-e181-4f76-a1ca-7131fc8ca7de",
  "panels": {
    "0": {
      "type": "optionsListControl",
      "order": 0,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "0",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.status",
        "title": "Status",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "selectedOptions": [
          "active"
        ],
        "hideActionBar": true,
        "persist": true,
        "hideExists": true,
        "existsSelected": false,
        "exclude": false
      }
    },
    "1": {
      "type": "optionsListControl",
      "order": 1,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "1",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.rule.name",
        "title": "Rule",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "hideExists": true,
        "selectedOptions": [],
        "existsSelected": false,
        "exclude": false
      }
    },
    "2": {
      "type": "optionsListControl",
      "order": 2,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "2",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.group.value",
        "title": "Group",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "selectedOptions": [],
        "existsSelected": false,
        "exclude": false
      }
    },
    "3": {
      "type": "optionsListControl",
      "order": 3,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "3",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "tags",
        "title": "Tags",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "selectedOptions": [],
        "existsSelected": false,
        "exclude": false
      }
    }
  },
  "defaultControlWidth": "small",
  "defaultControlGrow": true,
  "controlStyle": "oneLine",
  "chainingSystem": "HIERARCHICAL",
  "showApplySelections": false,
  "ignoreParentSettings": {
    "ignoreFilters": false,
    "ignoreQuery": false,
    "ignoreTimerange": false,
    "ignoreValidations": false
  },
  "filters": [
    {
      "meta": {
        "index": "unified-alerts-dv",
        "key": "kibana.alert.status",
        "disabled": false
      },
      "query": {
        "match_phrase": {
          "kibana.alert.status": "active"
        }
      }
    }
  ]
}
  1. Navigate to the Stack alerts page. It should crash.
@cnasikas cnasikas added bug Fixes for quality problems that affect the customer experience Feature:Alerting/RulesManagement Issues related to the Rules Management UX Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Sep 20, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Oct 4, 2024
…astic#194785)

## Summary

elastic#190561 introduced a breaking
change in the format of the controls embeddable configuration object
that caused usages in the Security and Stack alerts pages to break if
there was an old value saved in localStorage.

This PR makes the storage key for the alert filter controls configurable
and uses a new value for the usage in `<UrlSyncedAlertsSearchBar>`,
fixing the error in the Stack Alerts page.

## To verify

1. Checkout a revision prior to this PR
2. Create Stack rules that fire alerts
3. Visit the Stack Alerts page (should show a full-page error message,
if it doesn't see [If the page works correctly](#how-to-break))
4. Checkout this PR
5. Reload the Stack Alerts page
6. Verify that the page loads correctly

<details id="how-to-break">

<summary>If the page works correctly</summary>

You likely didn't have an old saved configuration for the controls bar
in the localStorage. In this case, create a localStorage item named
`stackAlerts.default.pageFilters` with the following content:

```json
{
  "panels": {
    "0": {
      "type": "optionsListControl",
      "order": 0,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "0",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.status",
        "title": "Status",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "selectedOptions": [
          "active"
        ],
        "hideActionBar": true,
        "persist": true,
        "hideExists": true
      }
    },
    "1": {
      "type": "optionsListControl",
      "order": 1,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "1",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.rule.name",
        "title": "Rule",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "hideExists": true
      }
    },
    "2": {
      "type": "optionsListControl",
      "order": 2,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "2",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.group.value",
        "title": "Group",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        }
      }
    },
    "3": {
      "type": "optionsListControl",
      "order": 3,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "3",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "tags",
        "title": "Tags",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        }
      }
    }
  },
  "labelPosition": "oneLine",
  "chainingSystem": "HIERARCHICAL",
  "autoApplySelections": true,
  "ignoreParentSettings": {
    "ignoreValidations": true
  },
  "editorConfig": {
    "hideWidthSettings": true,
    "hideDataViewSelector": true,
    "hideAdditionalSettings": true
  }
}
```
</details>

## References

Fixes elastic#193565

(cherry picked from commit ef3bc96)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Oct 4, 2024
…astic#194785)

## Summary

elastic#190561 introduced a breaking
change in the format of the controls embeddable configuration object
that caused usages in the Security and Stack alerts pages to break if
there was an old value saved in localStorage.

This PR makes the storage key for the alert filter controls configurable
and uses a new value for the usage in `<UrlSyncedAlertsSearchBar>`,
fixing the error in the Stack Alerts page.

## To verify

1. Checkout a revision prior to this PR
2. Create Stack rules that fire alerts
3. Visit the Stack Alerts page (should show a full-page error message,
if it doesn't see [If the page works correctly](#how-to-break))
4. Checkout this PR
5. Reload the Stack Alerts page
6. Verify that the page loads correctly

<details id="how-to-break">

<summary>If the page works correctly</summary>

You likely didn't have an old saved configuration for the controls bar
in the localStorage. In this case, create a localStorage item named
`stackAlerts.default.pageFilters` with the following content:

```json
{
  "panels": {
    "0": {
      "type": "optionsListControl",
      "order": 0,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "0",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.status",
        "title": "Status",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "selectedOptions": [
          "active"
        ],
        "hideActionBar": true,
        "persist": true,
        "hideExists": true
      }
    },
    "1": {
      "type": "optionsListControl",
      "order": 1,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "1",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.rule.name",
        "title": "Rule",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "hideExists": true
      }
    },
    "2": {
      "type": "optionsListControl",
      "order": 2,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "2",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.group.value",
        "title": "Group",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        }
      }
    },
    "3": {
      "type": "optionsListControl",
      "order": 3,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "3",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "tags",
        "title": "Tags",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        }
      }
    }
  },
  "labelPosition": "oneLine",
  "chainingSystem": "HIERARCHICAL",
  "autoApplySelections": true,
  "ignoreParentSettings": {
    "ignoreValidations": true
  },
  "editorConfig": {
    "hideWidthSettings": true,
    "hideDataViewSelector": true,
    "hideAdditionalSettings": true
  }
}
```
</details>

## References

Fixes elastic#193565

(cherry picked from commit ef3bc96)
kibanamachine added a commit that referenced this issue Oct 4, 2024
…ror (#194785) (#194942)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[ResponseOps][Alerts] Fix Stack Alerts page filter controls error
(#194785)](#194785)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Umberto
Pepato","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-04T12:44:11Z","message":"[ResponseOps][Alerts]
Fix Stack Alerts page filter controls error (#194785)\n\n##
Summary\r\n\r\nhttps://github.com//pull/190561 introduced
a breaking\r\nchange in the format of the controls embeddable
configuration object\r\nthat caused usages in the Security and Stack
alerts pages to break if\r\nthere was an old value saved in
localStorage.\r\n\r\nThis PR makes the storage key for the alert filter
controls configurable\r\nand uses a new value for the usage in
`<UrlSyncedAlertsSearchBar>`,\r\nfixing the error in the Stack Alerts
page.\r\n\r\n## To verify\r\n\r\n1. Checkout a revision prior to this
PR\r\n2. Create Stack rules that fire alerts\r\n3. Visit the Stack
Alerts page (should show a full-page error message,\r\nif it doesn't see
[If the page works correctly](#how-to-break))\r\n4. Checkout this
PR\r\n5. Reload the Stack Alerts page\r\n6. Verify that the page loads
correctly\r\n\r\n<details id=\"how-to-break\">\r\n\r\n<summary>If the
page works correctly</summary>\r\n\r\nYou likely didn't have an old
saved configuration for the controls bar\r\nin the localStorage. In this
case, create a localStorage item
named\r\n`stackAlerts.default.pageFilters` with the following
content:\r\n\r\n```json\r\n{\r\n \"panels\": {\r\n \"0\": {\r\n
\"type\": \"optionsListControl\",\r\n \"order\": 0,\r\n \"grow\":
true,\r\n \"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\":
\"0\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.status\",\r\n \"title\": \"Status\",\r\n \"hideExclude\":
true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\": true,\r\n
\"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"selectedOptions\": [\r\n
\"active\"\r\n ],\r\n \"hideActionBar\": true,\r\n \"persist\":
true,\r\n \"hideExists\": true\r\n }\r\n },\r\n \"1\": {\r\n \"type\":
\"optionsListControl\",\r\n \"order\": 1,\r\n \"grow\": true,\r\n
\"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\": \"1\",\r\n
\"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.rule.name\",\r\n \"title\": \"Rule\",\r\n
\"hideExclude\": true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\":
true,\r\n \"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"hideExists\": true\r\n }\r\n
},\r\n \"2\": {\r\n \"type\": \"optionsListControl\",\r\n \"order\":
2,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n \"explicitInput\":
{\r\n \"id\": \"2\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n
\"fieldName\": \"kibana.alert.group.value\",\r\n \"title\":
\"Group\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n },\r\n \"3\": {\r\n \"type\": \"optionsListControl\",\r\n
\"order\": 3,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n
\"explicitInput\": {\r\n \"id\": \"3\",\r\n \"dataViewId\":
\"unified-alerts-dv\",\r\n \"fieldName\": \"tags\",\r\n \"title\":
\"Tags\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n }\r\n },\r\n \"labelPosition\": \"oneLine\",\r\n
\"chainingSystem\": \"HIERARCHICAL\",\r\n \"autoApplySelections\":
true,\r\n \"ignoreParentSettings\": {\r\n \"ignoreValidations\":
true\r\n },\r\n \"editorConfig\": {\r\n \"hideWidthSettings\": true,\r\n
\"hideDataViewSelector\": true,\r\n \"hideAdditionalSettings\": true\r\n
}\r\n}\r\n```\r\n</details>\r\n\r\n## References\r\n\r\nFixes
#193565","sha":"ef3bc96e52f6c21bd1543d2cb48acef31f56022e","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:prev-major"],"title":"[ResponseOps][Alerts]
Fix Stack Alerts page filter controls
error","number":194785,"url":"https://github.com/elastic/kibana/pull/194785","mergeCommit":{"message":"[ResponseOps][Alerts]
Fix Stack Alerts page filter controls error (#194785)\n\n##
Summary\r\n\r\nhttps://github.com//pull/190561 introduced
a breaking\r\nchange in the format of the controls embeddable
configuration object\r\nthat caused usages in the Security and Stack
alerts pages to break if\r\nthere was an old value saved in
localStorage.\r\n\r\nThis PR makes the storage key for the alert filter
controls configurable\r\nand uses a new value for the usage in
`<UrlSyncedAlertsSearchBar>`,\r\nfixing the error in the Stack Alerts
page.\r\n\r\n## To verify\r\n\r\n1. Checkout a revision prior to this
PR\r\n2. Create Stack rules that fire alerts\r\n3. Visit the Stack
Alerts page (should show a full-page error message,\r\nif it doesn't see
[If the page works correctly](#how-to-break))\r\n4. Checkout this
PR\r\n5. Reload the Stack Alerts page\r\n6. Verify that the page loads
correctly\r\n\r\n<details id=\"how-to-break\">\r\n\r\n<summary>If the
page works correctly</summary>\r\n\r\nYou likely didn't have an old
saved configuration for the controls bar\r\nin the localStorage. In this
case, create a localStorage item
named\r\n`stackAlerts.default.pageFilters` with the following
content:\r\n\r\n```json\r\n{\r\n \"panels\": {\r\n \"0\": {\r\n
\"type\": \"optionsListControl\",\r\n \"order\": 0,\r\n \"grow\":
true,\r\n \"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\":
\"0\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.status\",\r\n \"title\": \"Status\",\r\n \"hideExclude\":
true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\": true,\r\n
\"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"selectedOptions\": [\r\n
\"active\"\r\n ],\r\n \"hideActionBar\": true,\r\n \"persist\":
true,\r\n \"hideExists\": true\r\n }\r\n },\r\n \"1\": {\r\n \"type\":
\"optionsListControl\",\r\n \"order\": 1,\r\n \"grow\": true,\r\n
\"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\": \"1\",\r\n
\"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.rule.name\",\r\n \"title\": \"Rule\",\r\n
\"hideExclude\": true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\":
true,\r\n \"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"hideExists\": true\r\n }\r\n
},\r\n \"2\": {\r\n \"type\": \"optionsListControl\",\r\n \"order\":
2,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n \"explicitInput\":
{\r\n \"id\": \"2\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n
\"fieldName\": \"kibana.alert.group.value\",\r\n \"title\":
\"Group\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n },\r\n \"3\": {\r\n \"type\": \"optionsListControl\",\r\n
\"order\": 3,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n
\"explicitInput\": {\r\n \"id\": \"3\",\r\n \"dataViewId\":
\"unified-alerts-dv\",\r\n \"fieldName\": \"tags\",\r\n \"title\":
\"Tags\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n }\r\n },\r\n \"labelPosition\": \"oneLine\",\r\n
\"chainingSystem\": \"HIERARCHICAL\",\r\n \"autoApplySelections\":
true,\r\n \"ignoreParentSettings\": {\r\n \"ignoreValidations\":
true\r\n },\r\n \"editorConfig\": {\r\n \"hideWidthSettings\": true,\r\n
\"hideDataViewSelector\": true,\r\n \"hideAdditionalSettings\": true\r\n
}\r\n}\r\n```\r\n</details>\r\n\r\n## References\r\n\r\nFixes
#193565","sha":"ef3bc96e52f6c21bd1543d2cb48acef31f56022e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194785","number":194785,"mergeCommit":{"message":"[ResponseOps][Alerts]
Fix Stack Alerts page filter controls error (#194785)\n\n##
Summary\r\n\r\nhttps://github.com//pull/190561 introduced
a breaking\r\nchange in the format of the controls embeddable
configuration object\r\nthat caused usages in the Security and Stack
alerts pages to break if\r\nthere was an old value saved in
localStorage.\r\n\r\nThis PR makes the storage key for the alert filter
controls configurable\r\nand uses a new value for the usage in
`<UrlSyncedAlertsSearchBar>`,\r\nfixing the error in the Stack Alerts
page.\r\n\r\n## To verify\r\n\r\n1. Checkout a revision prior to this
PR\r\n2. Create Stack rules that fire alerts\r\n3. Visit the Stack
Alerts page (should show a full-page error message,\r\nif it doesn't see
[If the page works correctly](#how-to-break))\r\n4. Checkout this
PR\r\n5. Reload the Stack Alerts page\r\n6. Verify that the page loads
correctly\r\n\r\n<details id=\"how-to-break\">\r\n\r\n<summary>If the
page works correctly</summary>\r\n\r\nYou likely didn't have an old
saved configuration for the controls bar\r\nin the localStorage. In this
case, create a localStorage item
named\r\n`stackAlerts.default.pageFilters` with the following
content:\r\n\r\n```json\r\n{\r\n \"panels\": {\r\n \"0\": {\r\n
\"type\": \"optionsListControl\",\r\n \"order\": 0,\r\n \"grow\":
true,\r\n \"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\":
\"0\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.status\",\r\n \"title\": \"Status\",\r\n \"hideExclude\":
true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\": true,\r\n
\"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"selectedOptions\": [\r\n
\"active\"\r\n ],\r\n \"hideActionBar\": true,\r\n \"persist\":
true,\r\n \"hideExists\": true\r\n }\r\n },\r\n \"1\": {\r\n \"type\":
\"optionsListControl\",\r\n \"order\": 1,\r\n \"grow\": true,\r\n
\"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\": \"1\",\r\n
\"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.rule.name\",\r\n \"title\": \"Rule\",\r\n
\"hideExclude\": true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\":
true,\r\n \"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"hideExists\": true\r\n }\r\n
},\r\n \"2\": {\r\n \"type\": \"optionsListControl\",\r\n \"order\":
2,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n \"explicitInput\":
{\r\n \"id\": \"2\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n
\"fieldName\": \"kibana.alert.group.value\",\r\n \"title\":
\"Group\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n },\r\n \"3\": {\r\n \"type\": \"optionsListControl\",\r\n
\"order\": 3,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n
\"explicitInput\": {\r\n \"id\": \"3\",\r\n \"dataViewId\":
\"unified-alerts-dv\",\r\n \"fieldName\": \"tags\",\r\n \"title\":
\"Tags\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n }\r\n },\r\n \"labelPosition\": \"oneLine\",\r\n
\"chainingSystem\": \"HIERARCHICAL\",\r\n \"autoApplySelections\":
true,\r\n \"ignoreParentSettings\": {\r\n \"ignoreValidations\":
true\r\n },\r\n \"editorConfig\": {\r\n \"hideWidthSettings\": true,\r\n
\"hideDataViewSelector\": true,\r\n \"hideAdditionalSettings\": true\r\n
}\r\n}\r\n```\r\n</details>\r\n\r\n## References\r\n\r\nFixes
#193565","sha":"ef3bc96e52f6c21bd1543d2cb48acef31f56022e"}}]}]
BACKPORT-->

Co-authored-by: Umberto Pepato <[email protected]>
kibanamachine added a commit that referenced this issue Oct 4, 2024
…or (#194785) (#194943)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ResponseOps][Alerts] Fix Stack Alerts page filter controls error
(#194785)](#194785)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Umberto
Pepato","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-04T12:44:11Z","message":"[ResponseOps][Alerts]
Fix Stack Alerts page filter controls error (#194785)\n\n##
Summary\r\n\r\nhttps://github.com//pull/190561 introduced
a breaking\r\nchange in the format of the controls embeddable
configuration object\r\nthat caused usages in the Security and Stack
alerts pages to break if\r\nthere was an old value saved in
localStorage.\r\n\r\nThis PR makes the storage key for the alert filter
controls configurable\r\nand uses a new value for the usage in
`<UrlSyncedAlertsSearchBar>`,\r\nfixing the error in the Stack Alerts
page.\r\n\r\n## To verify\r\n\r\n1. Checkout a revision prior to this
PR\r\n2. Create Stack rules that fire alerts\r\n3. Visit the Stack
Alerts page (should show a full-page error message,\r\nif it doesn't see
[If the page works correctly](#how-to-break))\r\n4. Checkout this
PR\r\n5. Reload the Stack Alerts page\r\n6. Verify that the page loads
correctly\r\n\r\n<details id=\"how-to-break\">\r\n\r\n<summary>If the
page works correctly</summary>\r\n\r\nYou likely didn't have an old
saved configuration for the controls bar\r\nin the localStorage. In this
case, create a localStorage item
named\r\n`stackAlerts.default.pageFilters` with the following
content:\r\n\r\n```json\r\n{\r\n \"panels\": {\r\n \"0\": {\r\n
\"type\": \"optionsListControl\",\r\n \"order\": 0,\r\n \"grow\":
true,\r\n \"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\":
\"0\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.status\",\r\n \"title\": \"Status\",\r\n \"hideExclude\":
true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\": true,\r\n
\"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"selectedOptions\": [\r\n
\"active\"\r\n ],\r\n \"hideActionBar\": true,\r\n \"persist\":
true,\r\n \"hideExists\": true\r\n }\r\n },\r\n \"1\": {\r\n \"type\":
\"optionsListControl\",\r\n \"order\": 1,\r\n \"grow\": true,\r\n
\"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\": \"1\",\r\n
\"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.rule.name\",\r\n \"title\": \"Rule\",\r\n
\"hideExclude\": true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\":
true,\r\n \"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"hideExists\": true\r\n }\r\n
},\r\n \"2\": {\r\n \"type\": \"optionsListControl\",\r\n \"order\":
2,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n \"explicitInput\":
{\r\n \"id\": \"2\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n
\"fieldName\": \"kibana.alert.group.value\",\r\n \"title\":
\"Group\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n },\r\n \"3\": {\r\n \"type\": \"optionsListControl\",\r\n
\"order\": 3,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n
\"explicitInput\": {\r\n \"id\": \"3\",\r\n \"dataViewId\":
\"unified-alerts-dv\",\r\n \"fieldName\": \"tags\",\r\n \"title\":
\"Tags\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n }\r\n },\r\n \"labelPosition\": \"oneLine\",\r\n
\"chainingSystem\": \"HIERARCHICAL\",\r\n \"autoApplySelections\":
true,\r\n \"ignoreParentSettings\": {\r\n \"ignoreValidations\":
true\r\n },\r\n \"editorConfig\": {\r\n \"hideWidthSettings\": true,\r\n
\"hideDataViewSelector\": true,\r\n \"hideAdditionalSettings\": true\r\n
}\r\n}\r\n```\r\n</details>\r\n\r\n## References\r\n\r\nFixes
#193565","sha":"ef3bc96e52f6c21bd1543d2cb48acef31f56022e","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:prev-major"],"title":"[ResponseOps][Alerts]
Fix Stack Alerts page filter controls
error","number":194785,"url":"https://github.com/elastic/kibana/pull/194785","mergeCommit":{"message":"[ResponseOps][Alerts]
Fix Stack Alerts page filter controls error (#194785)\n\n##
Summary\r\n\r\nhttps://github.com//pull/190561 introduced
a breaking\r\nchange in the format of the controls embeddable
configuration object\r\nthat caused usages in the Security and Stack
alerts pages to break if\r\nthere was an old value saved in
localStorage.\r\n\r\nThis PR makes the storage key for the alert filter
controls configurable\r\nand uses a new value for the usage in
`<UrlSyncedAlertsSearchBar>`,\r\nfixing the error in the Stack Alerts
page.\r\n\r\n## To verify\r\n\r\n1. Checkout a revision prior to this
PR\r\n2. Create Stack rules that fire alerts\r\n3. Visit the Stack
Alerts page (should show a full-page error message,\r\nif it doesn't see
[If the page works correctly](#how-to-break))\r\n4. Checkout this
PR\r\n5. Reload the Stack Alerts page\r\n6. Verify that the page loads
correctly\r\n\r\n<details id=\"how-to-break\">\r\n\r\n<summary>If the
page works correctly</summary>\r\n\r\nYou likely didn't have an old
saved configuration for the controls bar\r\nin the localStorage. In this
case, create a localStorage item
named\r\n`stackAlerts.default.pageFilters` with the following
content:\r\n\r\n```json\r\n{\r\n \"panels\": {\r\n \"0\": {\r\n
\"type\": \"optionsListControl\",\r\n \"order\": 0,\r\n \"grow\":
true,\r\n \"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\":
\"0\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.status\",\r\n \"title\": \"Status\",\r\n \"hideExclude\":
true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\": true,\r\n
\"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"selectedOptions\": [\r\n
\"active\"\r\n ],\r\n \"hideActionBar\": true,\r\n \"persist\":
true,\r\n \"hideExists\": true\r\n }\r\n },\r\n \"1\": {\r\n \"type\":
\"optionsListControl\",\r\n \"order\": 1,\r\n \"grow\": true,\r\n
\"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\": \"1\",\r\n
\"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.rule.name\",\r\n \"title\": \"Rule\",\r\n
\"hideExclude\": true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\":
true,\r\n \"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"hideExists\": true\r\n }\r\n
},\r\n \"2\": {\r\n \"type\": \"optionsListControl\",\r\n \"order\":
2,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n \"explicitInput\":
{\r\n \"id\": \"2\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n
\"fieldName\": \"kibana.alert.group.value\",\r\n \"title\":
\"Group\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n },\r\n \"3\": {\r\n \"type\": \"optionsListControl\",\r\n
\"order\": 3,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n
\"explicitInput\": {\r\n \"id\": \"3\",\r\n \"dataViewId\":
\"unified-alerts-dv\",\r\n \"fieldName\": \"tags\",\r\n \"title\":
\"Tags\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n }\r\n },\r\n \"labelPosition\": \"oneLine\",\r\n
\"chainingSystem\": \"HIERARCHICAL\",\r\n \"autoApplySelections\":
true,\r\n \"ignoreParentSettings\": {\r\n \"ignoreValidations\":
true\r\n },\r\n \"editorConfig\": {\r\n \"hideWidthSettings\": true,\r\n
\"hideDataViewSelector\": true,\r\n \"hideAdditionalSettings\": true\r\n
}\r\n}\r\n```\r\n</details>\r\n\r\n## References\r\n\r\nFixes
#193565","sha":"ef3bc96e52f6c21bd1543d2cb48acef31f56022e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194785","number":194785,"mergeCommit":{"message":"[ResponseOps][Alerts]
Fix Stack Alerts page filter controls error (#194785)\n\n##
Summary\r\n\r\nhttps://github.com//pull/190561 introduced
a breaking\r\nchange in the format of the controls embeddable
configuration object\r\nthat caused usages in the Security and Stack
alerts pages to break if\r\nthere was an old value saved in
localStorage.\r\n\r\nThis PR makes the storage key for the alert filter
controls configurable\r\nand uses a new value for the usage in
`<UrlSyncedAlertsSearchBar>`,\r\nfixing the error in the Stack Alerts
page.\r\n\r\n## To verify\r\n\r\n1. Checkout a revision prior to this
PR\r\n2. Create Stack rules that fire alerts\r\n3. Visit the Stack
Alerts page (should show a full-page error message,\r\nif it doesn't see
[If the page works correctly](#how-to-break))\r\n4. Checkout this
PR\r\n5. Reload the Stack Alerts page\r\n6. Verify that the page loads
correctly\r\n\r\n<details id=\"how-to-break\">\r\n\r\n<summary>If the
page works correctly</summary>\r\n\r\nYou likely didn't have an old
saved configuration for the controls bar\r\nin the localStorage. In this
case, create a localStorage item
named\r\n`stackAlerts.default.pageFilters` with the following
content:\r\n\r\n```json\r\n{\r\n \"panels\": {\r\n \"0\": {\r\n
\"type\": \"optionsListControl\",\r\n \"order\": 0,\r\n \"grow\":
true,\r\n \"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\":
\"0\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.status\",\r\n \"title\": \"Status\",\r\n \"hideExclude\":
true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\": true,\r\n
\"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"selectedOptions\": [\r\n
\"active\"\r\n ],\r\n \"hideActionBar\": true,\r\n \"persist\":
true,\r\n \"hideExists\": true\r\n }\r\n },\r\n \"1\": {\r\n \"type\":
\"optionsListControl\",\r\n \"order\": 1,\r\n \"grow\": true,\r\n
\"width\": \"small\",\r\n \"explicitInput\": {\r\n \"id\": \"1\",\r\n
\"dataViewId\": \"unified-alerts-dv\",\r\n \"fieldName\":
\"kibana.alert.rule.name\",\r\n \"title\": \"Rule\",\r\n
\"hideExclude\": true,\r\n \"hideSort\": true,\r\n \"hidePanelTitles\":
true,\r\n \"placeholder\": \"\",\r\n \"ignoreParentSettings\": {\r\n
\"ignoreValidations\": true\r\n },\r\n \"hideExists\": true\r\n }\r\n
},\r\n \"2\": {\r\n \"type\": \"optionsListControl\",\r\n \"order\":
2,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n \"explicitInput\":
{\r\n \"id\": \"2\",\r\n \"dataViewId\": \"unified-alerts-dv\",\r\n
\"fieldName\": \"kibana.alert.group.value\",\r\n \"title\":
\"Group\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n },\r\n \"3\": {\r\n \"type\": \"optionsListControl\",\r\n
\"order\": 3,\r\n \"grow\": true,\r\n \"width\": \"small\",\r\n
\"explicitInput\": {\r\n \"id\": \"3\",\r\n \"dataViewId\":
\"unified-alerts-dv\",\r\n \"fieldName\": \"tags\",\r\n \"title\":
\"Tags\",\r\n \"hideExclude\": true,\r\n \"hideSort\": true,\r\n
\"hidePanelTitles\": true,\r\n \"placeholder\": \"\",\r\n
\"ignoreParentSettings\": {\r\n \"ignoreValidations\": true\r\n }\r\n
}\r\n }\r\n },\r\n \"labelPosition\": \"oneLine\",\r\n
\"chainingSystem\": \"HIERARCHICAL\",\r\n \"autoApplySelections\":
true,\r\n \"ignoreParentSettings\": {\r\n \"ignoreValidations\":
true\r\n },\r\n \"editorConfig\": {\r\n \"hideWidthSettings\": true,\r\n
\"hideDataViewSelector\": true,\r\n \"hideAdditionalSettings\": true\r\n
}\r\n}\r\n```\r\n</details>\r\n\r\n## References\r\n\r\nFixes
#193565","sha":"ef3bc96e52f6c21bd1543d2cb48acef31f56022e"}}]}]
BACKPORT-->

Co-authored-by: Umberto Pepato <[email protected]>
tiansivive pushed a commit to tiansivive/kibana that referenced this issue Oct 7, 2024
…astic#194785)

## Summary

elastic#190561 introduced a breaking
change in the format of the controls embeddable configuration object
that caused usages in the Security and Stack alerts pages to break if
there was an old value saved in localStorage.

This PR makes the storage key for the alert filter controls configurable
and uses a new value for the usage in `<UrlSyncedAlertsSearchBar>`,
fixing the error in the Stack Alerts page.

## To verify

1. Checkout a revision prior to this PR
2. Create Stack rules that fire alerts
3. Visit the Stack Alerts page (should show a full-page error message,
if it doesn't see [If the page works correctly](#how-to-break))
4. Checkout this PR
5. Reload the Stack Alerts page
6. Verify that the page loads correctly

<details id="how-to-break">

<summary>If the page works correctly</summary>

You likely didn't have an old saved configuration for the controls bar
in the localStorage. In this case, create a localStorage item named
`stackAlerts.default.pageFilters` with the following content:

```json
{
  "panels": {
    "0": {
      "type": "optionsListControl",
      "order": 0,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "0",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.status",
        "title": "Status",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "selectedOptions": [
          "active"
        ],
        "hideActionBar": true,
        "persist": true,
        "hideExists": true
      }
    },
    "1": {
      "type": "optionsListControl",
      "order": 1,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "1",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.rule.name",
        "title": "Rule",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "hideExists": true
      }
    },
    "2": {
      "type": "optionsListControl",
      "order": 2,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "2",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.group.value",
        "title": "Group",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        }
      }
    },
    "3": {
      "type": "optionsListControl",
      "order": 3,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "3",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "tags",
        "title": "Tags",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        }
      }
    }
  },
  "labelPosition": "oneLine",
  "chainingSystem": "HIERARCHICAL",
  "autoApplySelections": true,
  "ignoreParentSettings": {
    "ignoreValidations": true
  },
  "editorConfig": {
    "hideWidthSettings": true,
    "hideDataViewSelector": true,
    "hideAdditionalSettings": true
  }
}
```
</details>

## References

Fixes elastic#193565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Alerting/RulesManagement Issues related to the Rules Management UX Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
2 participants