Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [ResponseOps][Cases] Miscount of total numbers of alerts in tel…
…emetry (#196112) (#197976) # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][Cases] Miscount of total numbers of alerts in telemetry (#196112)](#196112) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Georgiana-Andreea Onoleață","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-28T11:39:32Z","message":"[ResponseOps][Cases] Miscount of total numbers of alerts in telemetry (#196112)\n\nCloses https://github.com/elastic/kibana/issues/177208\r\n\r\n## Summary\r\n\r\nProblem: \r\n- the metrics collected in telemetry for alerts don't count the total\r\nnumber of alerts on a case correctly.\r\n\r\nSolution: \r\n- added new aggregation function: getUniqueAlertCommentsCountQuery,\r\nwhich is now responsible for defining the cardinality aggregation for\r\ncounting unique alert comments by alertId.\r\n- in the aggs section of the savedObjectsClient.find, the new\r\ncardinality aggregation query was added\r\n- the total number of alerts is updated to be the result extracted from\r\nthe new aggregation\r\n\r\nExample: \r\n\r\n![Screenshot 2024-10-22 at 15 20\r\n40](https://github.com/user-attachments/assets/c418c82e-2e35-4c7f-969d-7f4f25bdbc9d)\r\n\r\n\r\n- in the telemetry object, we have the following info: \r\n<img width=\"331\" alt=\"Screenshot 2024-10-22 at 15 21 40\"\r\nsrc=\"https://github.com/user-attachments/assets/6419e72d-84b4-4068-a741-6e32c6e966f7\">\r\n\r\n---------\r\n\r\nCo-authored-by: Antonio <[email protected]>","sha":"73c22a50fda298537f28bd000731b0584503e7ae","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor"],"title":"[ResponseOps][Cases] Miscount of total numbers of alerts in telemetry","number":196112,"url":"https://github.com/elastic/kibana/pull/196112","mergeCommit":{"message":"[ResponseOps][Cases] Miscount of total numbers of alerts in telemetry (#196112)\n\nCloses https://github.com/elastic/kibana/issues/177208\r\n\r\n## Summary\r\n\r\nProblem: \r\n- the metrics collected in telemetry for alerts don't count the total\r\nnumber of alerts on a case correctly.\r\n\r\nSolution: \r\n- added new aggregation function: getUniqueAlertCommentsCountQuery,\r\nwhich is now responsible for defining the cardinality aggregation for\r\ncounting unique alert comments by alertId.\r\n- in the aggs section of the savedObjectsClient.find, the new\r\ncardinality aggregation query was added\r\n- the total number of alerts is updated to be the result extracted from\r\nthe new aggregation\r\n\r\nExample: \r\n\r\n![Screenshot 2024-10-22 at 15 20\r\n40](https://github.com/user-attachments/assets/c418c82e-2e35-4c7f-969d-7f4f25bdbc9d)\r\n\r\n\r\n- in the telemetry object, we have the following info: \r\n<img width=\"331\" alt=\"Screenshot 2024-10-22 at 15 21 40\"\r\nsrc=\"https://github.com/user-attachments/assets/6419e72d-84b4-4068-a741-6e32c6e966f7\">\r\n\r\n---------\r\n\r\nCo-authored-by: Antonio <[email protected]>","sha":"73c22a50fda298537f28bd000731b0584503e7ae"}},"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/196112","number":196112,"mergeCommit":{"message":"[ResponseOps][Cases] Miscount of total numbers of alerts in telemetry (#196112)\n\nCloses https://github.com/elastic/kibana/issues/177208\r\n\r\n## Summary\r\n\r\nProblem: \r\n- the metrics collected in telemetry for alerts don't count the total\r\nnumber of alerts on a case correctly.\r\n\r\nSolution: \r\n- added new aggregation function: getUniqueAlertCommentsCountQuery,\r\nwhich is now responsible for defining the cardinality aggregation for\r\ncounting unique alert comments by alertId.\r\n- in the aggs section of the savedObjectsClient.find, the new\r\ncardinality aggregation query was added\r\n- the total number of alerts is updated to be the result extracted from\r\nthe new aggregation\r\n\r\nExample: \r\n\r\n![Screenshot 2024-10-22 at 15 20\r\n40](https://github.com/user-attachments/assets/c418c82e-2e35-4c7f-969d-7f4f25bdbc9d)\r\n\r\n\r\n- in the telemetry object, we have the following info: \r\n<img width=\"331\" alt=\"Screenshot 2024-10-22 at 15 21 40\"\r\nsrc=\"https://github.com/user-attachments/assets/6419e72d-84b4-4068-a741-6e32c6e966f7\">\r\n\r\n---------\r\n\r\nCo-authored-by: Antonio <[email protected]>","sha":"73c22a50fda298537f28bd000731b0584503e7ae"}}]}] BACKPORT--> Co-authored-by: Georgiana-Andreea Onoleață <[email protected]>
- Loading branch information