[8.19] Track toast errors using apm-rum (#217948)#218531
Merged
maryam-saeidi merged 1 commit intoelastic:8.19from Apr 17, 2025
Merged
[8.19] Track toast errors using apm-rum (#217948)#218531maryam-saeidi merged 1 commit intoelastic:8.19from
maryam-saeidi merged 1 commit intoelastic:8.19from
Conversation
Closes elastic/observability-dev#4022 ## Summary In this PR, we are capturing toast errors using apm-rum: https://github.com/user-attachments/assets/b61529f9-ab8e-4171-9042-0884e11eb385 ErrorType is available in labels which this feature was added to the rum agent in this [PR](elastic/apm-agent-rum-js#1594). ### 🧪 How to test Add the following to your kibana.yml file: ``` elastic.apm.active: true elastic.apm.transactionSampleRate: 1.0 elastic.apm.environment: yourName <-- Change to your name ``` <details> <summary>Throw a toast error</summary> Add this code to a page as [alerts page](https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/observability/public/pages/alerts/alerts.tsx) and visit http://localhost:5601/kibana/app/observability/alerts ``` useEffect(() => { const error = new Error('Mary test error > toasts.addError'); toasts.addError(error, { title: 'Testing error toast', toastMessage: error.message }); toasts.addDanger('Testing danger toast'); }, []); ``` </details> Then visit [kibana-cloud-apm.elastic.dev](https://kibana-cloud-apm.elastic.dev/app/apm/services/kibana-frontend/errors?comparisonEnabled=true&environment=ENVIRONMENT_ALL&kuery=&latencyAggregationType=avg&offset=1d&rangeFrom=now-1h&rangeTo=now&serviceGroup=&transactionType=page-load) filtered for `yourName` in the environment. (cherry picked from commit ae9e5d6) # Conflicts: # src/core/packages/notifications/browser-internal/src/toasts/toasts_api.tsx
shahzad31
approved these changes
Apr 17, 2025
maryam-saeidi
added a commit
that referenced
this pull request
Apr 17, 2025
# Backport This will backport the following commits from `main` to `9.0`: - [Track toast errors using apm-rum (#217948)](#217948) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maryam Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2025-04-15T07:49:11Z","message":"Track toast errors using apm-rum (#217948)\n\nCloses https://github.com/elastic/observability-dev/issues/4022\n\n## Summary\n\nIn this PR, we are capturing toast errors using apm-rum:\n\n\nhttps://github.com/user-attachments/assets/b61529f9-ab8e-4171-9042-0884e11eb385\n\n\nErrorType is available in labels which this feature was added to the rum\nagent in this\n[PR](https://github.com/elastic/apm-agent-rum-js/pull/1594).\n\n\n### 🧪 How to test\n\nAdd the following to your kibana.yml file:\n\n```\nelastic.apm.active: true\nelastic.apm.transactionSampleRate: 1.0\nelastic.apm.environment: yourName <-- Change to your name\n```\n<details>\n<summary>Throw a toast error</summary>\n\nAdd this code to a page as [alerts\npage](https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/observability/public/pages/alerts/alerts.tsx)\nand visit http://localhost:5601/kibana/app/observability/alerts\n\n```\nuseEffect(() => {\n const error = new Error('Mary test error > toasts.addError');\n toasts.addError(error, { title: 'Testing error toast', toastMessage: error.message });\n toasts.addDanger('Testing danger toast');\n }, []);\n```\n\n</details>\n\nThen visit\n[kibana-cloud-apm.elastic.dev](https://kibana-cloud-apm.elastic.dev/app/apm/services/kibana-frontend/errors?comparisonEnabled=true&environment=ENVIRONMENT_ALL&kuery=&latencyAggregationType=avg&offset=1d&rangeFrom=now-1h&rangeTo=now&serviceGroup=&transactionType=page-load)\nfiltered for `yourName` in the environment.","sha":"ae9e5d679ce1ace883ec7bae432b46f9c77f2758","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.1.0","v8.19.0","v9.0.1"],"title":"Track toast errors using apm-rum","number":217948,"url":"https://github.com/elastic/kibana/pull/217948","mergeCommit":{"message":"Track toast errors using apm-rum (#217948)\n\nCloses https://github.com/elastic/observability-dev/issues/4022\n\n## Summary\n\nIn this PR, we are capturing toast errors using apm-rum:\n\n\nhttps://github.com/user-attachments/assets/b61529f9-ab8e-4171-9042-0884e11eb385\n\n\nErrorType is available in labels which this feature was added to the rum\nagent in this\n[PR](https://github.com/elastic/apm-agent-rum-js/pull/1594).\n\n\n### 🧪 How to test\n\nAdd the following to your kibana.yml file:\n\n```\nelastic.apm.active: true\nelastic.apm.transactionSampleRate: 1.0\nelastic.apm.environment: yourName <-- Change to your name\n```\n<details>\n<summary>Throw a toast error</summary>\n\nAdd this code to a page as [alerts\npage](https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/observability/public/pages/alerts/alerts.tsx)\nand visit http://localhost:5601/kibana/app/observability/alerts\n\n```\nuseEffect(() => {\n const error = new Error('Mary test error > toasts.addError');\n toasts.addError(error, { title: 'Testing error toast', toastMessage: error.message });\n toasts.addDanger('Testing danger toast');\n }, []);\n```\n\n</details>\n\nThen visit\n[kibana-cloud-apm.elastic.dev](https://kibana-cloud-apm.elastic.dev/app/apm/services/kibana-frontend/errors?comparisonEnabled=true&environment=ENVIRONMENT_ALL&kuery=&latencyAggregationType=avg&offset=1d&rangeFrom=now-1h&rangeTo=now&serviceGroup=&transactionType=page-load)\nfiltered for `yourName` in the environment.","sha":"ae9e5d679ce1ace883ec7bae432b46f9c77f2758"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217948","number":217948,"mergeCommit":{"message":"Track toast errors using apm-rum (#217948)\n\nCloses https://github.com/elastic/observability-dev/issues/4022\n\n## Summary\n\nIn this PR, we are capturing toast errors using apm-rum:\n\n\nhttps://github.com/user-attachments/assets/b61529f9-ab8e-4171-9042-0884e11eb385\n\n\nErrorType is available in labels which this feature was added to the rum\nagent in this\n[PR](https://github.com/elastic/apm-agent-rum-js/pull/1594).\n\n\n### 🧪 How to test\n\nAdd the following to your kibana.yml file:\n\n```\nelastic.apm.active: true\nelastic.apm.transactionSampleRate: 1.0\nelastic.apm.environment: yourName <-- Change to your name\n```\n<details>\n<summary>Throw a toast error</summary>\n\nAdd this code to a page as [alerts\npage](https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/observability/public/pages/alerts/alerts.tsx)\nand visit http://localhost:5601/kibana/app/observability/alerts\n\n```\nuseEffect(() => {\n const error = new Error('Mary test error > toasts.addError');\n toasts.addError(error, { title: 'Testing error toast', toastMessage: error.message });\n toasts.addDanger('Testing danger toast');\n }, []);\n```\n\n</details>\n\nThen visit\n[kibana-cloud-apm.elastic.dev](https://kibana-cloud-apm.elastic.dev/app/apm/services/kibana-frontend/errors?comparisonEnabled=true&environment=ENVIRONMENT_ALL&kuery=&latencyAggregationType=avg&offset=1d&rangeFrom=now-1h&rangeTo=now&serviceGroup=&transactionType=page-load)\nfiltered for `yourName` in the environment.","sha":"ae9e5d679ce1ace883ec7bae432b46f9c77f2758"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"url":"https://github.com/elastic/kibana/pull/218531","number":218531,"branch":"8.19","state":"MERGED","mergeCommit":{"sha":"caa2fbb25501b65fa704c8f9cf2821cc4e18ea34","message":"[8.19] Track toast errors using apm-rum (#217948) (#218531)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.19`:\n- [Track toast errors using apm-rum\n(#217948)](https://github.com/elastic/kibana/pull/217948)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}}]}] BACKPORT-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation