-
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] Move to OSS #45769
[Telemetry] Move to OSS #45769
Conversation
💔 Build Failed |
src/legacy/core_plugins/telemetry/common/get_xpack_config_with_deprecated.ts
Show resolved
Hide resolved
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
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.
This is coming along nicely. There are some imports that probably need to change, and one spot in OSS that references xpack things, but otherwise good. I would suggest having someone from platform look at this and make sure they are OK with how the xpack overriding OSS function works.
src/legacy/core_plugins/telemetry/server/collectors/get_stats_oss.ts
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/telemetry/server/collectors/local/get_xpack.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/monitoring/server/telemetry/get_stats_with_monitoring.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/xpack_main/server/lib/replace_injected_vars.js
Outdated
Show resolved
Hide resolved
This is similar to how security & spaces override the saved objects client with Telemetry's requirements and implementation is a bit simpler which is a good thing, but it follows the same pattern of X-Pack overriding OSS so I would say 👍 |
x-pack/legacy/plugins/monitoring/server/telemetry/get_stats_with_monitoring.ts
Outdated
Show resolved
Hide resolved
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
@elasticmachine merge upstream |
merge conflict between base and head |
💚 Build Succeeded |
💚 Build Succeeded |
💔 Build Failed |
💚 Build Succeeded |
Since we've followed up with a change to deprecate the |
@epixa We'll make sure this PR is in the Enhancements section in the Release Notes |
Moving telemetry from xpack to oss.
Closes https://github.com/elastic/telemetry/issues/131
Closes https://github.com/elastic/dev/issues/1247
Overview:
So i've added in OSS a
telemetryCollectionManager
:https://github.com/elastic/kibana/blob/c01fd26af4b0379234558d185667d6b5bb4933b8/src/legacy/core_plugins/telemetry/server/collection_manager.ts
this is a class that keeps track of which stats getter to use, it does not know about monitoring or any other plugin.
in the
init
function of telemetry OSS it gets called with this:This registeres the oss telemetry stats getter which fetches "local" collectors just like it should.
OSS stats getter: https://github.com/elastic/kibana/blob/c01fd26af4b0379234558d185667d6b5bb4933b8/src/legacy/core_plugins/telemetry/server/collectors/get_stats_oss.ts
In the monitoring plugin
init
function we set a new stats getter:This registers the
getStatsWithMonitoring
under a higher priority (1 > 0) to be used instead of the one set in the telemetryinit
.This is the old stats getter which checks if monitoring is enabled to fetch monitoring stats, and defaults to the local collectors if that is false or fails. (no code changes here)
Monitoring stats getter: https://github.com/elastic/kibana/blob/c01fd26af4b0379234558d185667d6b5bb4933b8/x-pack/legacy/plugins/monitoring/server/telemetry/get_stats_with_monitoring.ts
At the API endpoint; instead of calling the
getStats
function directly to fetch the stats, we call this:so technically any plugin can now override how we fetch the stats, and specify a priority to know which one should be used when telemetry stats endpoint is being called.