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

[WIP] Move UsageCollection plugin to a Core Service #69306

Closed
wants to merge 9 commits into from

Conversation

afharo
Copy link
Member

@afharo afharo commented Jun 16, 2020

Summary

Related to #70779.

This is WIP to move the current UsageCollection plugin and convert it into a Core service.

TODOs:

  • Server side
    • Most codebase moved (see public side question)
    • Keep plugin as a wrapper so we don't need to migrate all plugins at once.
    • Be more explicit with exported APIs and typings
    • Documentation
  • Public side
    • Is it OK to move ui_metric and application_usage logics to core?
      There is a tight dependency to the @kbn/analytics reporter. We might want to revisit it to keep it split in the plugins 👀
  • Change CODEOWNERS file (on a separate PR to make backports easier)
  • Add more tests (can be done on a separate PR for progress).

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@afharo afharo added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Telemetry v8.0.0 Team:KibanaTelemetry labels Jun 16, 2020
@afharo afharo force-pushed the move-usage-collection-to-core branch from 6bea618 to a0f4a60 Compare June 30, 2020 19:17
Comment on lines +21 to +29
export {
CollectorOptions as UsageCollectionCollectorOptions,
CollectorFormatForBulkUpload as UsageCollectionCollectorFormatForBulkUpload,
Collector as UsageCollectionCollector,
Purify as UsageCollectionPurify,
UsageCollector as UsageCollectionUsageCollector,
MakeSchemaFrom as UsageCollectionMakeSchemaFrom,
AllowedSchemaTypes as UsageCollectionAllowedSchemaTypes,
} from './collectors';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming all interfaces when exposing them publicly to match the prefix-pattern in core.

@@ -1,6 +1,6 @@
{
"id": "usageCollection",
"configPath": ["usageCollection"],
"configPath": ["usageCollection.uiMetric"],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this because the config "usageCollection" is already registered by core. We are extending only the config re uiMetric for the public-end code

maximumWaitTimeForAllCollectorsInS: schema.number({
defaultValue: DEFAULT_MAXIMUM_WAIT_TIME_FOR_ALL_COLLECTORS_IN_S,
}),
enabled: schema.boolean({ defaultValue: true }),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is the risk that disabling uiMetric, we'll disable this entire plugin (the core service would still be there though)?

Collector,
} from './collector';
export { UsageCollectionSetup } from './plugin';
UsageCollectionPluginSetup as UsageCollectionSetup,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using UsageCollectionPluginSetup because it has the @deprecated flag, encouraging to move to the core service.

@kibanamachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@TinaHeiligers
Copy link
Contributor

No longer needed. Core will expose a telemetry-only API as suggested here

@afharo
Copy link
Member Author

afharo commented Jul 7, 2020

Closing it in favour of the approach discussed in #56762 (comment)

@afharo afharo closed this Jul 7, 2020
@afharo afharo deleted the move-usage-collection-to-core branch October 1, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Telemetry Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants