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

[Profiling,Infra,APM] Disable Profiling integration by default #175201

Merged

Conversation

mykolaharmash
Copy link
Contributor

@mykolaharmash mykolaharmash commented Jan 22, 2024

Closes #175016

Summary

This PR disables the Profiling integration in Infra and APM by default on the plugin configuration level because this integration require users to first configure the main profiling plugin. On-prem users will have to manually enable both integrations once they enabled the Universal Profiling for their hosts. Cloud users will have Infra and APM integrations enabled by default because on Cloud instances Universal Profiling is already configured. A PR for the default Cloud settings will follow after this one is merged.

Changes I've made:

  • Disabled the Infra integration be default
  • Introduced a new APM feature flag for the Profiling integration
  • Made sure all the places in APM that rely on Profiling integration respect the new feature flag
  • Fixed a bug in APM when Universal Profiling was shown even though the integration was disabled in UI settings
CleanShot.2024-01-22.at.13.31.40.mp4

How To Test

  1. Checkout locally
  2. Make sure you don't have xpack.infra.featureFlags.profilingEnabled already enabled in kibana.yml
  3. Open kibana and make sure you don't see "Universal Profiling" tab in Host and Service details
  4. Enabled both flags in kibana.yml: xpack.infra.featureFlags.profilingEnabled and xpack.apm.featureFlags.profilingIntegrationAvailable: true
  5. Check that now you see "Universal Profiling" tab in the details screens in both Infra and APM
  6. Go to Infra settings view and disable the Profiling integration, make sure the tab disappears
    1. Go to APM settings view and disable the Profiling integration, make sure the tab disappears

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@mykolaharmash mykolaharmash force-pushed the 175016-cloud-only-profiling-integration branch 2 times, most recently from da815e5 to f4df01e Compare January 22, 2024 12:49
@mykolaharmash mykolaharmash added release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.12.1 labels Jan 22, 2024
@mykolaharmash mykolaharmash marked this pull request as ready for review January 22, 2024 12:50
@mykolaharmash mykolaharmash requested review from a team as code owners January 22, 2024 12:50
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@mykolaharmash
Copy link
Contributor Author

/ci

@mykolaharmash mykolaharmash force-pushed the 175016-cloud-only-profiling-integration branch from f4df01e to b8449e7 Compare January 22, 2024 14:07
@@ -213,6 +213,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
'xpack.apm.featureFlags.migrationToFleetAvailable (any)',
'xpack.apm.featureFlags.sourcemapApiAvailable (any)',
'xpack.apm.featureFlags.storageExplorerAvailable (any)',
'xpack.apm.featureFlags.profilingIntegrationAvailable (any)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we specify 'boolean' here due to the strict schema?

profilingIntegrationAvailable: schema.boolean({ defaultValue: false }),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done ✅

@jennypavlova jennypavlova self-requested a review January 23, 2024 09:45
Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked locally with the provided steps and it works as described. I have one question: Should we have the option to enable profiling in the settings if the xpack.profiling.enabled: true and the flags are not set in the kibana.yml? I find it a bit odd to have the option in the settings and for example to disable the profiling there and then to remove the flags from the config and the option to enable it disappears 🤔

profiling_settingd.mov

I think the expected behavior will be to always have the flags in the settings and only the value to change (with false as a default option) Wdyt?

x-pack/plugins/apm/public/index.ts Show resolved Hide resolved
@mykolaharmash
Copy link
Contributor Author

I checked locally with the provided steps and it works as described. I have one question: Should we have the option to enable profiling in the settings if the xpack.profiling.enabled: true and the flags are not set in the kibana.yml? I find it a bit odd to have the option in the settings and for example to disable the profiling there and then to remove the flags from the config and the option to enable it disappears 🤔

profiling_settingd.mov
I think the expected behavior will be to always have the flags in the settings and only the value to change (with false as a default option) Wdyt?

The things is, if we keep the toggle in Settings while the plugin is disabled, the toggle would have no effect regardless of it's state, because the plugin configuration takes precedence. That's why I decided to hide the toggle altogether if the feature flag is off to not confuse users that might expect something to happen if they toggle it on. Does this makes sense or I'm missing something?

@mykolaharmash
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The things is, if we keep the toggle in Settings while the plugin is disabled, the toggle would have no effect regardless of it's state, because the plugin configuration takes precedence. That's why I decided to hide the toggle altogether if the feature flag is off to not confuse users that might expect something to happen if they toggle it on.

That makes sense, thanks for explaining!
I found the behavior confusing only in the case when setting it to off in the settings and then if the plugin feature flag is removed from the config and then set to true again it will still be off (because the settings config will be the one used even if it's enabled in the kibana.yml file after it is set to false in the settings)- that's probably an edge case and not likely to happen.

But overall it works fine, thanks for the fixes :)

Copy link
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kibana Security changes LGTM

@mykolaharmash
Copy link
Contributor Author

@elasticmachine merge upstream

@mykolaharmash
Copy link
Contributor Author

That makes sense, thanks for explaining!
I found the behavior confusing only in the case when setting it to off in the settings and then if the plugin feature flag is removed from the config and then set to true again it will still be off (because the settings config will be the one used even if it's enabled in the kibana.yml file after it is set to false in the settings)- that's probably an edge case and not likely to happen.

Ah, now I see what you mean, thank you for clarifying. But I agree that this would be rather an edge-case and I hope if that happens user would remember to check the ui setting when they re-enable the plugin flag because at some point they've toggled it off and at least should be aware that it exists 🤞

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #35 / Serverless observability API - feature flags Custom Threshold Rule Custom Threshold rule - DOCUMENTS_COUNT - FIRED Rule creation should set correct information in the alert document

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1600 1601 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 3.1MB 3.1MB +268.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mykolaharmash mykolaharmash merged commit abd3515 into elastic:main Jan 24, 2024
21 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.12 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.12:
- [Infra UI] Fix Open in Logs links in Infra and APM when in Serverless (#172137)

Manual backport

To create the backport manually run:

node scripts/backport --pr 175201

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 175201 locally

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jan 25, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 175201 locally

@mykolaharmash
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.12

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

mykolaharmash added a commit to mykolaharmash/kibana that referenced this pull request Feb 7, 2024
…ic#175201)

Closes elastic#175016

## Summary

This PR disables the Profiling integration in Infra and APM by default
on the plugin configuration level because this integration require users
to first configure the main `profiling` plugin. On-prem users will have
to manually enable both integrations once they enabled the Universal
Profiling for their hosts. Cloud users will have Infra and APM
integrations enabled by default because on Cloud instances Universal
Profiling is already configured. A PR for the default Cloud settings
will follow after this one is merged.

Changes I've made:
* Disabled the Infra integration be default
* Introduced a new APM feature flag for the Profiling integration
* Made sure all the places in APM that rely on Profiling integration
respect the new feature flag
* Fixed a bug in APM when Universal Profiling was shown even though the
integration was disabled in UI settings

https://github.com/elastic/kibana/assets/793851/65dfbb5b-1850-4d18-a92a-6ad59e0436a3

## How To Test

1. Checkout locally
2. Make sure you don't have `xpack.infra.featureFlags.profilingEnabled`
already enabled in `kibana.yml`
3. Open kibana and make sure you don't see "Universal Profiling" tab in
Host and Service details
4. Enabled both flags in `kibana.yml`:
`xpack.infra.featureFlags.profilingEnabled` and
`xpack.apm.featureFlags.profilingIntegrationAvailable: true`
5. Check that now you see "Universal Profiling" tab in the details
screens in both Infra and APM
6. Go to Infra settings view and disable the Profiling integration, make
sure the tab disappears
7. 6. Go to APM settings view and disable the Profiling integration,
make sure the tab disappears

---------

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit abd3515)

# Conflicts:
#	x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx
#	x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx
mykolaharmash added a commit that referenced this pull request Feb 7, 2024
…#175201) (#176406)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Profiling,Infra,APM] Disable Profiling integration by default
(#175201)](#175201)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Mykola
Harmash","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-24T11:44:26Z","message":"[Profiling,Infra,APM]
Disable Profiling integration by default (#175201)\n\nCloses
https://github.com/elastic/kibana/issues/175016\r\n\r\n##
Summary\r\n\r\nThis PR disables the Profiling integration in Infra and
APM by default\r\non the plugin configuration level because this
integration require users\r\nto first configure the main `profiling`
plugin. On-prem users will have\r\nto manually enable both integrations
once they enabled the Universal\r\nProfiling for their hosts. Cloud
users will have Infra and APM\r\nintegrations enabled by default because
on Cloud instances Universal\r\nProfiling is already configured. A PR
for the default Cloud settings\r\nwill follow after this one is
merged.\r\n\r\nChanges I've made:\r\n* Disabled the Infra integration be
default\r\n* Introduced a new APM feature flag for the Profiling
integration\r\n* Made sure all the places in APM that rely on Profiling
integration\r\nrespect the new feature flag\r\n* Fixed a bug in APM when
Universal Profiling was shown even though the\r\nintegration was
disabled in UI
settings\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/793851/65dfbb5b-1850-4d18-a92a-6ad59e0436a3\r\n\r\n##
How To Test\r\n\r\n1. Checkout locally\r\n2. Make sure you don't have
`xpack.infra.featureFlags.profilingEnabled`\r\nalready enabled in
`kibana.yml`\r\n3. Open kibana and make sure you don't see \"Universal
Profiling\" tab in\r\nHost and Service details\r\n4. Enabled both flags
in `kibana.yml`:\r\n`xpack.infra.featureFlags.profilingEnabled`
and\r\n`xpack.apm.featureFlags.profilingIntegrationAvailable:
true`\r\n5. Check that now you see \"Universal Profiling\" tab in the
details\r\nscreens in both Infra and APM\r\n6. Go to Infra settings view
and disable the Profiling integration, make\r\nsure the tab
disappears\r\n7. 6. Go to APM settings view and disable the Profiling
integration,\r\nmake sure the tab
disappears\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"abd3515dda40d48bd0c59f7d2861ffa86db133c1","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","Team:obs-ux-infra_services","v8.12.1","v8.13.0"],"number":175201,"url":"https://github.com/elastic/kibana/pull/175201","mergeCommit":{"message":"[Profiling,Infra,APM]
Disable Profiling integration by default (#175201)\n\nCloses
https://github.com/elastic/kibana/issues/175016\r\n\r\n##
Summary\r\n\r\nThis PR disables the Profiling integration in Infra and
APM by default\r\non the plugin configuration level because this
integration require users\r\nto first configure the main `profiling`
plugin. On-prem users will have\r\nto manually enable both integrations
once they enabled the Universal\r\nProfiling for their hosts. Cloud
users will have Infra and APM\r\nintegrations enabled by default because
on Cloud instances Universal\r\nProfiling is already configured. A PR
for the default Cloud settings\r\nwill follow after this one is
merged.\r\n\r\nChanges I've made:\r\n* Disabled the Infra integration be
default\r\n* Introduced a new APM feature flag for the Profiling
integration\r\n* Made sure all the places in APM that rely on Profiling
integration\r\nrespect the new feature flag\r\n* Fixed a bug in APM when
Universal Profiling was shown even though the\r\nintegration was
disabled in UI
settings\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/793851/65dfbb5b-1850-4d18-a92a-6ad59e0436a3\r\n\r\n##
How To Test\r\n\r\n1. Checkout locally\r\n2. Make sure you don't have
`xpack.infra.featureFlags.profilingEnabled`\r\nalready enabled in
`kibana.yml`\r\n3. Open kibana and make sure you don't see \"Universal
Profiling\" tab in\r\nHost and Service details\r\n4. Enabled both flags
in `kibana.yml`:\r\n`xpack.infra.featureFlags.profilingEnabled`
and\r\n`xpack.apm.featureFlags.profilingIntegrationAvailable:
true`\r\n5. Check that now you see \"Universal Profiling\" tab in the
details\r\nscreens in both Infra and APM\r\n6. Go to Infra settings view
and disable the Profiling integration, make\r\nsure the tab
disappears\r\n7. 6. Go to APM settings view and disable the Profiling
integration,\r\nmake sure the tab
disappears\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"abd3515dda40d48bd0c59f7d2861ffa86db133c1"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175201","number":175201,"mergeCommit":{"message":"[Profiling,Infra,APM]
Disable Profiling integration by default (#175201)\n\nCloses
https://github.com/elastic/kibana/issues/175016\r\n\r\n##
Summary\r\n\r\nThis PR disables the Profiling integration in Infra and
APM by default\r\non the plugin configuration level because this
integration require users\r\nto first configure the main `profiling`
plugin. On-prem users will have\r\nto manually enable both integrations
once they enabled the Universal\r\nProfiling for their hosts. Cloud
users will have Infra and APM\r\nintegrations enabled by default because
on Cloud instances Universal\r\nProfiling is already configured. A PR
for the default Cloud settings\r\nwill follow after this one is
merged.\r\n\r\nChanges I've made:\r\n* Disabled the Infra integration be
default\r\n* Introduced a new APM feature flag for the Profiling
integration\r\n* Made sure all the places in APM that rely on Profiling
integration\r\nrespect the new feature flag\r\n* Fixed a bug in APM when
Universal Profiling was shown even though the\r\nintegration was
disabled in UI
settings\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/793851/65dfbb5b-1850-4d18-a92a-6ad59e0436a3\r\n\r\n##
How To Test\r\n\r\n1. Checkout locally\r\n2. Make sure you don't have
`xpack.infra.featureFlags.profilingEnabled`\r\nalready enabled in
`kibana.yml`\r\n3. Open kibana and make sure you don't see \"Universal
Profiling\" tab in\r\nHost and Service details\r\n4. Enabled both flags
in `kibana.yml`:\r\n`xpack.infra.featureFlags.profilingEnabled`
and\r\n`xpack.apm.featureFlags.profilingIntegrationAvailable:
true`\r\n5. Check that now you see \"Universal Profiling\" tab in the
details\r\nscreens in both Infra and APM\r\n6. Go to Infra settings view
and disable the Profiling integration, make\r\nsure the tab
disappears\r\n7. 6. Go to APM settings view and disable the Profiling
integration,\r\nmake sure the tab
disappears\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"abd3515dda40d48bd0c59f7d2861ffa86db133c1"}}]}]
BACKPORT-->
@kibanamachine kibanamachine added v8.12.2 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Feb 7, 2024
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
…ic#175201)

Closes elastic#175016

## Summary

This PR disables the Profiling integration in Infra and APM by default
on the plugin configuration level because this integration require users
to first configure the main `profiling` plugin. On-prem users will have
to manually enable both integrations once they enabled the Universal
Profiling for their hosts. Cloud users will have Infra and APM
integrations enabled by default because on Cloud instances Universal
Profiling is already configured. A PR for the default Cloud settings
will follow after this one is merged.

Changes I've made:
* Disabled the Infra integration be default
* Introduced a new APM feature flag for the Profiling integration
* Made sure all the places in APM that rely on Profiling integration
respect the new feature flag
* Fixed a bug in APM when Universal Profiling was shown even though the
integration was disabled in UI settings


https://github.com/elastic/kibana/assets/793851/65dfbb5b-1850-4d18-a92a-6ad59e0436a3

## How To Test

1. Checkout locally
2. Make sure you don't have `xpack.infra.featureFlags.profilingEnabled`
already enabled in `kibana.yml`
3. Open kibana and make sure you don't see "Universal Profiling" tab in
Host and Service details
4. Enabled both flags in `kibana.yml`:
`xpack.infra.featureFlags.profilingEnabled` and
`xpack.apm.featureFlags.profilingIntegrationAvailable: true`
5. Check that now you see "Universal Profiling" tab in the details
screens in both Infra and APM
6. Go to Infra settings view and disable the Profiling integration, make
sure the tab disappears
7. 6. Go to APM settings view and disable the Profiling integration,
make sure the tab disappears

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.12.1 v8.12.2 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Profiling, Infra, APM] Enable APM/Infra + Profiling integration only for Cloud deployments
7 participants