[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.
Direction looks good!
I have a few suggestions:
- We cannot be calling
xpackAPIs from OSS. To solve this see (2). - Let us define
getLicenseas part of thecollectionManagerapi just likegetStatsandcluster 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
Bamieh
left a comment
There was a problem hiding this comment.
LGTM, thanks! i did not pull the code locally to test it
|
|
||
| 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.
can we group them in 1 promise.all so we dont have to wait for them sequentially?
There was a problem hiding this comment.
Good call! Just pushed the update :)
| return { | ||
| ...(license ? { license } : {}), | ||
| ...stat, | ||
| collectionSource: collection.title, |
|
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: |
…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