-
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
[Telemetry] Synchronous setup
and start
methods
#79457
[Telemetry] Synchronous setup
and start
methods
#79457
Conversation
Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry) |
@@ -131,18 +131,16 @@ export class TelemetryPlugin implements Plugin<TelemetryPluginSetup, TelemetryPl | |||
}; | |||
} | |||
|
|||
public async start(core: CoreStart, { telemetryCollectionManager }: TelemetryPluginsDepsStart) { | |||
public start(core: CoreStart, { telemetryCollectionManager }: TelemetryPluginsDepsStart) { | |||
const { savedObjects, uiSettings, elasticsearch } = core; | |||
this.savedObjectsClient = savedObjects.createInternalRepository(); | |||
const savedObjectsClient = new SavedObjectsClient(this.savedObjectsClient); | |||
this.uiSettingsClient = uiSettings.asScopedToClient(savedObjectsClient); | |||
this.elasticsearchClient = elasticsearch.client; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I am slightly worried about any side affects that might result from not awaiting
handleOldSettings
. Telemetry might be enabled/disabled inside this function yet if we are not awaiting it other functions might not pick up the right value. What do you think? -
Can we move all the above (
savedObjectsClient
anduiSettingsClient
from line 136) to thehandleOldSettings
function? Since it is an async function these sync methods will not block the main thread when called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! Makes sense! I think we had all the private clients because we used to instantiate the collectors in this plugin. But now they live in kibana_usage_collection
, so it makes sense to only use them where appropriate.
I'll push an update in a sec!
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I love this solution.
# Conflicts: # src/plugins/telemetry/server/plugin.ts
…into feature/task_manager_429 * 'feature/task_manager_429' of github.com:elastic/kibana: (158 commits) Add license check to direct package upload handler. (#79653) [Ingest Manager] Rename API /api/ingest_manager => /api/fleet (#79193) [Security Solution][Resolver] Simplify CopyableField styling and add comments (#79594) Fine-tunes ML related text on Metrics UI (#79425) [ML] DF Analytics creation wizard: ensure job creation possible when model memory lower than estimate (#79229) Add new "Add Data" tutorials (#77237) Update APM telemetry docs (#79583) Revert "Add support for runtime field types to mappings editor. (#77420)" (#79611) Kibana request headers (#79218) ensure missing indexPattern error is bubbled up to error callout (#79378) Missing space fix (#79585) remove duplicate tab states (#79501) [data.ui] Lazy load UI components in data plugin. (#78889) Add generic type params to search dependency. (#79608) [Ingest Manager] Internal action for policy reassign (#78493) [ILM] Add index_codec to forcemerge action in hot and warm phases (#78175) [Ingest Manager] Update open API spec and add condition to agent upgrade endpoint (#79579) [ML] Hide Data Grid column options when histogram charts are enabled. (#79459) [Telemetry] Synchronous `setup` and `start` methods (#79457) [Observability] Persist time range across apps (#79258) ...
Pinging @elastic/kibana-core (Team:Core) |
Summary
Remove the
async
condition of thesetup
andstart
methods in thetelemetry
plugin.Resolves #79452.
For maintainers