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

[Usage collection] move plugin to core #101146

Open
3 tasks
Tracked by #96641
Bamieh opened this issue Jun 2, 2021 · 7 comments
Open
3 tasks
Tracked by #96641

[Usage collection] move plugin to core #101146

Bamieh opened this issue Jun 2, 2021 · 7 comments
Labels
Feature:Telemetry impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@Bamieh
Copy link
Member

Bamieh commented Jun 2, 2021

Summary

Usage collection plugin exposes apis for other plugins to send telemetry from the browser and server. Having these apis exposed via a plugin instead having it as a core service has several drawbacks:

  1. Usage collection is a core service, owned by the core team, and used by most kibana plugins.
  2. Currently we have a 'hacky' way to send core usage. since core is initialized before the usage plugin we need to kindof hydrate the data after plugins are setup.
  3. (tiny nit) Usage collection cannot be disabled

Is this a breaking change?

No. We do not recommend or document this API for outside contributors. Any usage sent by external plugins is not used at Elastic.

Is this a big change?

Yes. The following steps are required to complete this task:

  • Moving the plugin and integrating it into core as a service.
  • (Separate PR) Rewiring plugins to drop the usage collection plugin and using the core service.
    • If we do not want to do this step in the same PR we can keep the plugin as a placeholder that only returns the core.usageCollection contracts.
    • The drawback here is that we'd need to communicate with teams to do this themselves within the next releases.
  • (Separate PR) Removing the core_usage service and using the usage_collection service in core instead.
@Bamieh Bamieh added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Telemetry Team:KibanaTelemetry labels Jun 2, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@pgayvallet
Copy link
Contributor

Moving the plugin and integrating it into core as a service.

(Separate PR) Rewiring plugins to drop the usage collection plugin and using the core service.

How will we manage the transition period if we do that in 2 steps? Will the usage collection plugin bridge to the new core service during this time?

@Bamieh
Copy link
Member Author

Bamieh commented Jun 9, 2021

Will the usage collection plugin bridge to the new core service during this time?

Yes just directly returning the core.usageCollection contracts from the plugin should be enough during that period

@afharo
Copy link
Member

afharo commented Aug 17, 2021

I started doing so long ago (#69306) but closed the PR because we changed our plans.

I'd be happy to dust off those changes again :)

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Nov 4, 2021
@afharo
Copy link
Member

afharo commented Jan 27, 2022

Alternative approach: how about moving the APIs to a Package? Would it be possible?

@pgayvallet
Copy link
Contributor

how about moving the APIs to a Package? Would it be possible?

I don't know the usage collection internal implementation that well, but it's using core services, right? I'm guessing at least savedObjects. Moving usage collection to a package means that it would still require to be instantiated from a plugin or from core to connect it to the core services it requires to function. Plus, the core service's types being in src/core/server, it would require an additional level of abstraction between core interfaces/types and the ones required by usage collection, as packages can't import anything from src/...

Given that, I'm not sure there would be any upside compared to moving it to core?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Telemetry impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

5 participants