[8.19] [Core] Expose isFeatureAvailable method from pricing API server setup (#223525)#225966
Merged
kibanamachine merged 1 commit intoelastic:8.19from Jul 1, 2025
Merged
Conversation
…elastic#223525) ## 📓 Summary This work exposes an asynchronous `coreSetup.pricing.isFeatureAvailable()` method to assert whether Kibana is running on a given pricing product during a plugin server setup lifecycle step. ## Why do we need it? Some feature registrations are synchronous in the plugin setup, and until all the plugins have registered their features, knowing features availability at the server setup step is not possible. ## How does this fix it? To guarantee we have access to all the registered features during the setup lifecycle, the process works so that: 1. All the plugins are set up and the product features are registered synchronously. 2. Once all the plugins are set, the core pricing service emits a signal. 3. The `isFeatureAvailable` method on setup, if invoked previously, resolves asynchronously, reacting to the emitted signal. This guarantees access to the product feature model anywhere in Kibana, without having to rely on the raw tier configuration values. ```ts public setup(core: CoreSetup) { core.pricing.registerProductFeatures([ { id: 'my-plugin:feature1', description: 'A feature for observability products', products: [ { name: 'observability', tier: 'complete' }, ], } ]); core.pricing.isFeatureAvailable('my-plugin:feature1').then((isActiveObservabilityComplete) => { if (isActiveObservabilityComplete) { // Enable feature1 } }); } ``` (cherry picked from commit 44c11da)
62923e3 to
0748453
Compare
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Public APIs missing comments
Page load bundle
Unknown metric groupsAPI count
cc @tonyghiani |
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