-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Separate the license retrieval from the stats in the usage collectors #57332
[Telemetry] Separate the license retrieval from the stats in the usage collectors #57332
Conversation
Pinging @elastic/pulse (Team:Pulse) |
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.
Direction looks good!
I have a few suggestions:
- We cannot be calling
xpack
APIs from OSS. To solve this see (2). - Let us define
getLicense
as part of thecollectionManager
api just likegetStats
andcluster uuids
. This way we can still have the implementation decoupled from where the data is fetched from (monitoring/oss/xpack/others). - I dont think we should really worry about the performance cost of calling the license api. Telemetry is called a few times per day at max.
One idea is to use the license API to register the license fetching instead of depending on our own implementation (in the license_manager
plugin) We can open a separate issue/PR for this one though.
…ge-oss-and-xpack-collectors
…ge-oss-and-xpack-collectors
…ge-oss-and-xpack-collectors
…ge-oss-and-xpack-collectors
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.
LGTM, thanks! i did not pull the code locally to test it
@@ -141,7 +169,17 @@ export class TelemetryCollectionManager { | |||
return; | |||
} | |||
|
|||
return await collection.statsGetter(clustersDetails, statsCollectionConfig); | |||
const stats = await collection.statsGetter(clustersDetails, statsCollectionConfig); | |||
const licenses = await collection.licenseGetter(clustersDetails, statsCollectionConfig); |
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.
can we group them in 1 promise.all
so we dont have to wait for them sequentially?
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.
Good call! Just pushed the update :)
return { | ||
...(license ? { license } : {}), | ||
...stat, | ||
collectionSource: collection.title, |
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.
👍
Anyone in the @elastic/stack-monitoring team can have a quick look at these changes? Thank you :) |
@elasticmachine merge upstream |
💚 Build SucceededHistory
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.
Looks good 👍
…e collectors (elastic#57332) * [Telemetry] Merge OSS and XPack usage collectors * Create X-Pack collector again * Separate the license retrieval from the stats * Fix telemetry tests with new fields * Use Promise.all to retrieve license and stats at the same time * Fix moment mock Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…e collectors (#57332) (#58450) * [Telemetry] Merge OSS and XPack usage collectors * Create X-Pack collector again * Separate the license retrieval from the stats * Fix telemetry tests with new fields * Use Promise.all to retrieve license and stats at the same time * Fix moment mock Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…re/files-and-filetree * 'master' of github.com:elastic/kibana: (174 commits) [SIEM] Fix unnecessary re-renders on the Overview page (elastic#56587) Don't mutate error message (elastic#58452) Fix service map popover transaction duration (elastic#58422) [ML] Adding filebeat config to file dataviz (elastic#58152) [Uptime] Improve refresh handling when generating test data (elastic#58285) [Logs / Metrics UI] Remove path prefix from ViewSourceConfigur… (elastic#58238) [ML] Functional tests - adjust classification model memory (elastic#58445) [ML] Use event.timezone instead of beat.timezone in file upload (elastic#58447) [Logs UI] Unskip and stabilitize log column configuration tests (elastic#58392) [Telemetry] Separate the license retrieval from the stats in the usage collectors (elastic#57332) hide welcome screen for cloud (elastic#58371) Move src/legacy/ui/public/notify/app_redirect to kibana_legacy (elastic#58127) [ML] Functional tests - stabilize typing during df analytics creation (elastic#58227) fix short url in spaces (elastic#58313) [SIEM] Upgrades cypress to version 4.0.2 (elastic#58400) [Index management] Move to new platform "plugins" folder (elastic#58109) [kbn/optimizer] disable parallelization in terser plugin (elastic#58396) [Uptime] Delete useless try...catch blocks (elastic#58263) [Uptime] Use scripted metric for snapshot calculation (elastic#58247) (elastic#58389) [APM] Stabilize agent configuration API (elastic#57767) ... # Conflicts: # src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx
Pinging @elastic/kibana-core (Team:Core) |
Summary
Separate the license retrieval from the stats fetchers in the usage collectors. This way we can allocate and understand where the logic fails and still have the right license information even when other info might be failing to be retrieved.
Fixes #56967
Checklist
Delete any items that are not applicable to this PR.
For maintainers