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

add feature flags to apm config and serverless.oblt.yml #159136

Merged

Conversation

MiriamAparicio
Copy link
Contributor

@MiriamAparicio MiriamAparicio commented Jun 6, 2023

Closes #159040

Add configuration values to hide UI components and block api in serverless.oblt.yml

Examples

Non Serverless
image

Serverless
image

@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.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@MiriamAparicio MiriamAparicio force-pushed the 159040-add-config-feature-flags branch from e83afd8 to f40dd45 Compare June 12, 2023 09:00
@MiriamAparicio MiriamAparicio added Team:APM All issues that need APM UI Team support release_note:feature Makes this part of the condensed release notes apm:serverless v8.9.0 labels Jun 12, 2023
@MiriamAparicio MiriamAparicio marked this pull request as ready for review June 12, 2023 09:35
@MiriamAparicio MiriamAparicio requested a review from a team as a code owner June 12, 2023 09:35
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

schema.boolean({
defaultValue: false,
}),
schema.oneOf([schema.literal(true)], { defaultValue: true })
Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala Jun 12, 2023

Choose a reason for hiding this comment

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

I didn't understand the notEqual logic here.

Basically, if we are not running in serverless context, its being enforced to a true literal check and the default value could be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's like and if/else

Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala Jun 12, 2023

Choose a reason for hiding this comment

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

Yes, i understand the schema.conditional.
What i don't get it is, when we are not running in serverless mode, you always want this settings to be true ? This is what i don't get it.

This config means

If we are running in serverless mode, then default value is false, but it would give *.yml file the preference. Which mean in serverless.oblt.yml file, it needs to be set as true only then it will be enabled.

If we are not running in serverless mode, it will always be true.

is this the expected behaviour ?

Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala Jun 12, 2023

Choose a reason for hiding this comment

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

Reason for asking this is, since you are setting it as true in non serverless mode, you will have to update the security teams tests also where they check for exposed settings.

This might also need documentation update for these exposed settings. The moment you update the security tests, someone from the security team will provide more details

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we are not running in serverless mode, it will always be true.

is this the expected behaviour ?

Yes, we want these values to be true when we are not in serverless

This might also need documentation update for these exposed settings. The moment you update the security tests, someone from the security team will provide more details

As you said I needed to update the security test and the team was ping to review these changes, I'm waiting for them for more details

@MiriamAparicio MiriamAparicio force-pushed the 159040-add-config-feature-flags branch from 748888b to bf0a260 Compare June 12, 2023 15:14
@MiriamAparicio MiriamAparicio requested a review from a team as a code owner June 12, 2023 15:14
@MiriamAparicio MiriamAparicio force-pushed the 159040-add-config-feature-flags branch from bf0a260 to 3c8b968 Compare June 12, 2023 16:22
@MiriamAparicio MiriamAparicio force-pushed the 159040-add-config-feature-flags branch from e7a0959 to eca126c Compare June 13, 2023 13:58
'xpack.apm.featureFlags.infraUiAvailable (any)',
'xpack.apm.featureFlags.migrationToFleetAvailable (any)',
'xpack.apm.featureFlags.sourcemapApiAvailable (any)',
'xpack.apm.featureFlags.storageExplorerAvailable (any)',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these should be booleans

Copy link
Contributor Author

@MiriamAparicio MiriamAparicio Jun 14, 2023

Choose a reason for hiding this comment

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

hi @thomheymann,
I set them initially to boolean in this commit bf0a260, but the test were failing
image

Copy link
Contributor

Choose a reason for hiding this comment

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

That's strange. Maybe the renderer doesn't infer the type correctly because of the context conditional:
https://github.com/elastic/kibana/pull/159136/files#diff-fa8fe01d402a7eb5cbc387759a4ea3930f3cc056d90477c04232d3ab91afaac7R17-R25
Let's leave as is for now in that case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes if we use a conditional rendering, the renderer is currently unable to infer the type based on provided default value. Hence it will always result in any type

Copy link
Contributor

@thomheymann thomheymann left a comment

Choose a reason for hiding this comment

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

LGTM!

@MiriamAparicio MiriamAparicio force-pushed the 159040-add-config-feature-flags branch from 1ef4e1c to fd927d2 Compare June 19, 2023 07:35
@MiriamAparicio MiriamAparicio requested a review from a team as a code owner June 19, 2023 07:35
Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼 Good work with the flags

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

config/serverless.oblt.yml changes LGTM

Comment on lines +30 to +37
## Disable APM UI components and API calls
xpack.apm.featureFlags.agentConfigurationAvailable: false
xpack.apm.featureFlags.configurableIndicesAvailable: false
xpack.apm.featureFlags.infrastructureTabAvailable: false
xpack.apm.featureFlags.infraUiAvailable: false
xpack.apm.featureFlags.migrationToFleetAvailable: false
xpack.apm.featureFlags.sourcemapApiAvailable: false
xpack.apm.featureFlags.storageExplorerAvailable: false
Copy link
Member

@afharo afharo Jun 19, 2023

Choose a reason for hiding this comment

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

NIT: we could also use the YAML tree format to avoid repetition 😇

Suggested change
## Disable APM UI components and API calls
xpack.apm.featureFlags.agentConfigurationAvailable: false
xpack.apm.featureFlags.configurableIndicesAvailable: false
xpack.apm.featureFlags.infrastructureTabAvailable: false
xpack.apm.featureFlags.infraUiAvailable: false
xpack.apm.featureFlags.migrationToFleetAvailable: false
xpack.apm.featureFlags.sourcemapApiAvailable: false
xpack.apm.featureFlags.storageExplorerAvailable: false
## Disable APM UI components and API calls
xpack.apm.featureFlags:
agentConfigurationAvailable: false
configurableIndicesAvailable: false
infrastructureTabAvailable: false
infraUiAvailable: false
migrationToFleetAvailable: false
sourcemapApiAvailable: false
storageExplorerAvailable: false

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
apm 46 47 +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.6MB 3.6MB -333.0B
Unknown metric groups

API count

id before after diff
apm 46 47 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 13 15 +2
securitySolution 411 415 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 14 16 +2
securitySolution 494 498 +4
total +6

History

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

@MiriamAparicio MiriamAparicio merged commit 56ac338 into elastic:main Jun 19, 2023
@MiriamAparicio MiriamAparicio deleted the 159040-add-config-feature-flags branch June 19, 2023 10:18
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:serverless backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team:APM All issues that need APM UI Team support v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Add configuration in serveless.oblt.yml for APM feature flags
9 participants