NP server setup APIs requiring access to start APIs #54886
Labels
blocker
discuss
Feature:New Platform
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
(this is probably the server-side counterpart of #49691)
This ticket is to discuss with @elastic/kibana-platform the possible solutions around the issue of
setup
API's requiring access tostart
API's to register logic that should be executed after startup.Issue
In NP, lifecycle is split in two steps:
setup
andstart
. We ask plugins to perform all configuration/registration during setup.However in some cases, the registered objects are meant to be using
start
API, which are not yet accessible.First exemple that comes to mind is the telemetry usage collector:
kibana/src/legacy/core_plugins/telemetry/server/collectors/management/telemetry_management_collector.ts
Lines 33 to 63 in ebd2c21
The collector creation requires to access a
uiSettingClient
, which is only accessible via a core'sstart
API.but the registration is then done with a
usageCollection
'ssetup
API:This code works in legacy, as the plugin got access to both
setup
andstart
at the same time, but cannot currently be migrated (therefor the blocker label).Proposal
#49691 address this issue on the client-side by adding the
getStartServices
API, and at this time we did not see any need to do the same on server-side, but I think we now have a valid reason to do the same.By implementing
getStartServices
to the server-side, the previous code could then be properly migrated to NP and be executed duringsetup
:The text was updated successfully, but these errors were encountered: