-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Profiling] fix bug when APM integration is no available #165809
Merged
cauemarcondes
merged 3 commits into
elastic:main
from
cauemarcondes:profiling-fix-apm-server-bug
Sep 6, 2023
Merged
[Profiling] fix bug when APM integration is no available #165809
cauemarcondes
merged 3 commits into
elastic:main
from
cauemarcondes:profiling-fix-apm-server-bug
Sep 6, 2023
Conversation
This file contains 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
cauemarcondes
added
release_note:skip
Skip the PR/issue when compiling release notes
v8.10.0
labels
Sep 6, 2023
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
cauemarcondes
changed the title
[Profiling] fix bug when APM server is no available
[Profiling] fix bug when APM integration is no available
Sep 6, 2023
/oblt-deploy |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
inge4pres
approved these changes
Sep 6, 2023
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Sep 6, 2023
) We've identified a buggy scenario when a user has a cluster prior 8.5 and wants to upgrade to >8.9. In this case, Profiling looks after the `elastic-cloud-apm` integration to see if Profiling had been enabled previously. But for the versions before 8.5 this integration did not exist under this name causing the set up to crash. I fixed the issue by catching the exception and returning that profiling is not enabled on the apm server, as it's not installed. Before: ``` Error: Saved object [ingest-package-policies/elastic-cloud-apm] not found at Function.createGenericNotFoundError (saved_objects_error_helpers.ts:258:28) at performGet (get.ts:80:36) at processTicksAndRejections (node:internal/process/task_queues:95:5) at SavedObjectsRepository.get (repository.ts:370:12) at SavedObjectsClient.get (saved_objects_client.ts:119:12) at PackagePolicyClientImpl.get (package_policy.ts:495:29) at validateProfilingInApmPackagePolicy (fleet_policies.ts:193:23) at async Promise.all (index 5) at setup.ts:99:31 at Router.handle (router.ts:212:30) at handler (router.ts:162:13) at exports.Manager.execute (/Users/caue.marcondes/elastic/other_kibana/node_modules/@hapi/hapi/lib ``` After: ``` { "has_setup": false, "has_data": false, "pre_8_9_1_data": false } ``` --------- Co-authored-by: Francesco Gualazzi <[email protected]> (cherry picked from commit a00e5e3)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Sep 6, 2023
) We've identified a buggy scenario when a user has a cluster prior 8.5 and wants to upgrade to >8.9. In this case, Profiling looks after the `elastic-cloud-apm` integration to see if Profiling had been enabled previously. But for the versions before 8.5 this integration did not exist under this name causing the set up to crash. I fixed the issue by catching the exception and returning that profiling is not enabled on the apm server, as it's not installed. Before: ``` Error: Saved object [ingest-package-policies/elastic-cloud-apm] not found at Function.createGenericNotFoundError (saved_objects_error_helpers.ts:258:28) at performGet (get.ts:80:36) at processTicksAndRejections (node:internal/process/task_queues:95:5) at SavedObjectsRepository.get (repository.ts:370:12) at SavedObjectsClient.get (saved_objects_client.ts:119:12) at PackagePolicyClientImpl.get (package_policy.ts:495:29) at validateProfilingInApmPackagePolicy (fleet_policies.ts:193:23) at async Promise.all (index 5) at setup.ts:99:31 at Router.handle (router.ts:212:30) at handler (router.ts:162:13) at exports.Manager.execute (/Users/caue.marcondes/elastic/other_kibana/node_modules/@hapi/hapi/lib ``` After: ``` { "has_setup": false, "has_data": false, "pre_8_9_1_data": false } ``` --------- Co-authored-by: Francesco Gualazzi <[email protected]> (cherry picked from commit a00e5e3)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Sep 6, 2023
…) (#165835) # Backport This will backport the following commits from `main` to `8.9`: - [[Profiling] fix bug when APM integration is no available (#165809)](#165809) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cauê Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-09-06T11:29:42Z","message":"[Profiling] fix bug when APM integration is no available (#165809)\n\nWe've identified a buggy scenario when a user has a cluster prior 8.5\r\nand wants to upgrade to >8.9. In this case, Profiling looks after the\r\n`elastic-cloud-apm` integration to see if Profiling had been enabled\r\npreviously. But for the versions before 8.5 this integration did not\r\nexist under this name causing the set up to crash.\r\n\r\nI fixed the issue by catching the exception and returning that profiling\r\nis not enabled on the apm server, as it's not installed.\r\n\r\nBefore:\r\n```\r\nError: Saved object [ingest-package-policies/elastic-cloud-apm] not found\r\n at Function.createGenericNotFoundError (saved_objects_error_helpers.ts:258:28)\r\n at performGet (get.ts:80:36)\r\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at SavedObjectsRepository.get (repository.ts:370:12)\r\n at SavedObjectsClient.get (saved_objects_client.ts:119:12)\r\n at PackagePolicyClientImpl.get (package_policy.ts:495:29)\r\n at validateProfilingInApmPackagePolicy (fleet_policies.ts:193:23)\r\n at async Promise.all (index 5)\r\n at setup.ts:99:31\r\n at Router.handle (router.ts:212:30)\r\n at handler (router.ts:162:13)\r\n at exports.Manager.execute (/Users/caue.marcondes/elastic/other_kibana/node_modules/@hapi/hapi/lib\r\n```\r\n\r\nAfter:\r\n```\r\n{\r\n \"has_setup\": false,\r\n \"has_data\": false,\r\n \"pre_8_9_1_data\": false\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Francesco Gualazzi <[email protected]>","sha":"a00e5e378800d0eda047b59228a48b816541e132","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:skip","ci:build-cloud-image","v8.10.0","v8.11.0","v8.9.3"],"number":165809,"url":"https://github.com/elastic/kibana/pull/165809","mergeCommit":{"message":"[Profiling] fix bug when APM integration is no available (#165809)\n\nWe've identified a buggy scenario when a user has a cluster prior 8.5\r\nand wants to upgrade to >8.9. In this case, Profiling looks after the\r\n`elastic-cloud-apm` integration to see if Profiling had been enabled\r\npreviously. But for the versions before 8.5 this integration did not\r\nexist under this name causing the set up to crash.\r\n\r\nI fixed the issue by catching the exception and returning that profiling\r\nis not enabled on the apm server, as it's not installed.\r\n\r\nBefore:\r\n```\r\nError: Saved object [ingest-package-policies/elastic-cloud-apm] not found\r\n at Function.createGenericNotFoundError (saved_objects_error_helpers.ts:258:28)\r\n at performGet (get.ts:80:36)\r\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at SavedObjectsRepository.get (repository.ts:370:12)\r\n at SavedObjectsClient.get (saved_objects_client.ts:119:12)\r\n at PackagePolicyClientImpl.get (package_policy.ts:495:29)\r\n at validateProfilingInApmPackagePolicy (fleet_policies.ts:193:23)\r\n at async Promise.all (index 5)\r\n at setup.ts:99:31\r\n at Router.handle (router.ts:212:30)\r\n at handler (router.ts:162:13)\r\n at exports.Manager.execute (/Users/caue.marcondes/elastic/other_kibana/node_modules/@hapi/hapi/lib\r\n```\r\n\r\nAfter:\r\n```\r\n{\r\n \"has_setup\": false,\r\n \"has_data\": false,\r\n \"pre_8_9_1_data\": false\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Francesco Gualazzi <[email protected]>","sha":"a00e5e378800d0eda047b59228a48b816541e132"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","8.9"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165809","number":165809,"mergeCommit":{"message":"[Profiling] fix bug when APM integration is no available (#165809)\n\nWe've identified a buggy scenario when a user has a cluster prior 8.5\r\nand wants to upgrade to >8.9. In this case, Profiling looks after the\r\n`elastic-cloud-apm` integration to see if Profiling had been enabled\r\npreviously. But for the versions before 8.5 this integration did not\r\nexist under this name causing the set up to crash.\r\n\r\nI fixed the issue by catching the exception and returning that profiling\r\nis not enabled on the apm server, as it's not installed.\r\n\r\nBefore:\r\n```\r\nError: Saved object [ingest-package-policies/elastic-cloud-apm] not found\r\n at Function.createGenericNotFoundError (saved_objects_error_helpers.ts:258:28)\r\n at performGet (get.ts:80:36)\r\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at SavedObjectsRepository.get (repository.ts:370:12)\r\n at SavedObjectsClient.get (saved_objects_client.ts:119:12)\r\n at PackagePolicyClientImpl.get (package_policy.ts:495:29)\r\n at validateProfilingInApmPackagePolicy (fleet_policies.ts:193:23)\r\n at async Promise.all (index 5)\r\n at setup.ts:99:31\r\n at Router.handle (router.ts:212:30)\r\n at handler (router.ts:162:13)\r\n at exports.Manager.execute (/Users/caue.marcondes/elastic/other_kibana/node_modules/@hapi/hapi/lib\r\n```\r\n\r\nAfter:\r\n```\r\n{\r\n \"has_setup\": false,\r\n \"has_data\": false,\r\n \"pre_8_9_1_data\": false\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Francesco Gualazzi <[email protected]>","sha":"a00e5e378800d0eda047b59228a48b816541e132"}},{"branch":"8.9","label":"v8.9.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Cauê Marcondes <[email protected]>
kibanamachine
added a commit
that referenced
this pull request
Sep 6, 2023
) (#165833) # Backport This will backport the following commits from `main` to `8.10`: - [[Profiling] fix bug when APM integration is no available (#165809)](#165809) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cauê Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-09-06T11:29:42Z","message":"[Profiling] fix bug when APM integration is no available (#165809)\n\nWe've identified a buggy scenario when a user has a cluster prior 8.5\r\nand wants to upgrade to >8.9. In this case, Profiling looks after the\r\n`elastic-cloud-apm` integration to see if Profiling had been enabled\r\npreviously. But for the versions before 8.5 this integration did not\r\nexist under this name causing the set up to crash.\r\n\r\nI fixed the issue by catching the exception and returning that profiling\r\nis not enabled on the apm server, as it's not installed.\r\n\r\nBefore:\r\n```\r\nError: Saved object [ingest-package-policies/elastic-cloud-apm] not found\r\n at Function.createGenericNotFoundError (saved_objects_error_helpers.ts:258:28)\r\n at performGet (get.ts:80:36)\r\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at SavedObjectsRepository.get (repository.ts:370:12)\r\n at SavedObjectsClient.get (saved_objects_client.ts:119:12)\r\n at PackagePolicyClientImpl.get (package_policy.ts:495:29)\r\n at validateProfilingInApmPackagePolicy (fleet_policies.ts:193:23)\r\n at async Promise.all (index 5)\r\n at setup.ts:99:31\r\n at Router.handle (router.ts:212:30)\r\n at handler (router.ts:162:13)\r\n at exports.Manager.execute (/Users/caue.marcondes/elastic/other_kibana/node_modules/@hapi/hapi/lib\r\n```\r\n\r\nAfter:\r\n```\r\n{\r\n \"has_setup\": false,\r\n \"has_data\": false,\r\n \"pre_8_9_1_data\": false\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Francesco Gualazzi <[email protected]>","sha":"a00e5e378800d0eda047b59228a48b816541e132","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:skip","ci:build-cloud-image","v8.10.0","v8.11.0","v8.9.3"],"number":165809,"url":"https://github.com/elastic/kibana/pull/165809","mergeCommit":{"message":"[Profiling] fix bug when APM integration is no available (#165809)\n\nWe've identified a buggy scenario when a user has a cluster prior 8.5\r\nand wants to upgrade to >8.9. In this case, Profiling looks after the\r\n`elastic-cloud-apm` integration to see if Profiling had been enabled\r\npreviously. But for the versions before 8.5 this integration did not\r\nexist under this name causing the set up to crash.\r\n\r\nI fixed the issue by catching the exception and returning that profiling\r\nis not enabled on the apm server, as it's not installed.\r\n\r\nBefore:\r\n```\r\nError: Saved object [ingest-package-policies/elastic-cloud-apm] not found\r\n at Function.createGenericNotFoundError (saved_objects_error_helpers.ts:258:28)\r\n at performGet (get.ts:80:36)\r\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at SavedObjectsRepository.get (repository.ts:370:12)\r\n at SavedObjectsClient.get (saved_objects_client.ts:119:12)\r\n at PackagePolicyClientImpl.get (package_policy.ts:495:29)\r\n at validateProfilingInApmPackagePolicy (fleet_policies.ts:193:23)\r\n at async Promise.all (index 5)\r\n at setup.ts:99:31\r\n at Router.handle (router.ts:212:30)\r\n at handler (router.ts:162:13)\r\n at exports.Manager.execute (/Users/caue.marcondes/elastic/other_kibana/node_modules/@hapi/hapi/lib\r\n```\r\n\r\nAfter:\r\n```\r\n{\r\n \"has_setup\": false,\r\n \"has_data\": false,\r\n \"pre_8_9_1_data\": false\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Francesco Gualazzi <[email protected]>","sha":"a00e5e378800d0eda047b59228a48b816541e132"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","8.9"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165809","number":165809,"mergeCommit":{"message":"[Profiling] fix bug when APM integration is no available (#165809)\n\nWe've identified a buggy scenario when a user has a cluster prior 8.5\r\nand wants to upgrade to >8.9. In this case, Profiling looks after the\r\n`elastic-cloud-apm` integration to see if Profiling had been enabled\r\npreviously. But for the versions before 8.5 this integration did not\r\nexist under this name causing the set up to crash.\r\n\r\nI fixed the issue by catching the exception and returning that profiling\r\nis not enabled on the apm server, as it's not installed.\r\n\r\nBefore:\r\n```\r\nError: Saved object [ingest-package-policies/elastic-cloud-apm] not found\r\n at Function.createGenericNotFoundError (saved_objects_error_helpers.ts:258:28)\r\n at performGet (get.ts:80:36)\r\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at SavedObjectsRepository.get (repository.ts:370:12)\r\n at SavedObjectsClient.get (saved_objects_client.ts:119:12)\r\n at PackagePolicyClientImpl.get (package_policy.ts:495:29)\r\n at validateProfilingInApmPackagePolicy (fleet_policies.ts:193:23)\r\n at async Promise.all (index 5)\r\n at setup.ts:99:31\r\n at Router.handle (router.ts:212:30)\r\n at handler (router.ts:162:13)\r\n at exports.Manager.execute (/Users/caue.marcondes/elastic/other_kibana/node_modules/@hapi/hapi/lib\r\n```\r\n\r\nAfter:\r\n```\r\n{\r\n \"has_setup\": false,\r\n \"has_data\": false,\r\n \"pre_8_9_1_data\": false\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Francesco Gualazzi <[email protected]>","sha":"a00e5e378800d0eda047b59228a48b816541e132"}},{"branch":"8.9","label":"v8.9.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Cauê Marcondes <[email protected]>
This PR didn't make it into the latest BC for 8.8.2 Updating the labels |
This was referenced Oct 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport
ci:build-cloud-image
release_note:skip
Skip the PR/issue when compiling release notes
v8.9.3
v8.10.0
v8.11.0
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.
We've identified a buggy scenario when a user has a cluster prior 8.5 and wants to upgrade to >8.9. In this case, Profiling looks after the
elastic-cloud-apm
integration to see if Profiling had been enabled previously. But for the versions before 8.5 this integration did not exist under this name causing the set up to crash.I fixed the issue by catching the exception and returning that profiling is not enabled on the apm server, as it's not installed.
Before:
After: