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

Makes usage collection methods available on start #69836

Conversation

jasonrhodes
Copy link
Member

Fixes #69835

I'm not sure if this is how you all would do this so please feel free to suggest other things, especially with regard to how to handle the start cycle hook if this.reporter is for some strange reason not available. I think throwing an error is the right call there but I may misunderstand the context where that could happen, but we will still need to somehow return the right type from the function even in that case, if we aren't going to throw.

@jasonrhodes jasonrhodes requested a review from Bamieh June 24, 2020 18:21
@jasonrhodes jasonrhodes added the release_note:skip Skip the PR/issue when compiling release notes label Jun 24, 2020
@@ -90,7 +95,7 @@ export class UsageCollectionPlugin implements Plugin<UsageCollectionSetup> {

public start({ http, application }: CoreStart) {
if (!this.reporter) {
return;
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure the best way to handle this but it shouldn't ever happen as far as I understand it?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, i believe its there since private reporter?: Reporter; is not initialized by the constructor so it must be optional.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Now we have to always return the contract, so I switched it to throw in this ("impossible"?) case.

Copy link
Member

Choose a reason for hiding this comment

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

Throwing an error sounds reasonable here, if for any reason it was not registered consumers will start throwing -harder to understand- errors anyways.

@jasonrhodes jasonrhodes marked this pull request as ready for review June 24, 2020 18:33
@jasonrhodes jasonrhodes requested a review from a team as a code owner June 24, 2020 18:33
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

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

@jasonrhodes jasonrhodes merged commit 1851348 into elastic:master Jun 25, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 25, 2020
* master: (45 commits)
  [QA] Unskip functional tests (elastic#69760)
  [SIEM][Detection Engine] - Update DE to work with new exceptions schema (elastic#69715)
  Fixes elastic#69639: Ignore url.url fields above 2048 characters (elastic#69863)
  PR: Provide limit warnings to user when API limits are reached. (elastic#69590)
  [Maps] Remove broken button (elastic#69853)
  Makes usage collection methods available on start (elastic#69836)
  [SIEM][CASE] Improve Jira's labelling (elastic#69892)
  [Logs UI] Access ML via the programmatic plugin API (elastic#68905)
  [ML] DF Analytics: Creation wizard part 3 (elastic#69456)
  Update Resolver generator script documentation (elastic#69912)
  [ML] Changes View results button text on new job page (elastic#69809)
  Add master branch to backport config (elastic#69893)
  [Ingest Manager] Kibana, not EPR, controls removable packages (elastic#69761)
  unskips 'Events columns' test (elastic#69684)
  [ML] Changes the ML overview empty analytics panel text (elastic#69801)
  [DOCS] Emphasizes where File Data Visualizer is located. (elastic#69812)
  add the `exactRoute` property to app registration (elastic#69772)
  Bump backport to 5.4.6 (elastic#69880)
  [Logs UI] ML log integration splash screen (elastic#69288)
  Clean up TSVB type client code to conform to the schema (elastic#68519)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 25, 2020
* master: (90 commits)
  [Encrypted Saved Objects] Adds support for migrations in ESO (elastic#69513)
  [SIEM] Replace WithSource with useWithSource hook (elastic#68722)
  [Endpoint]EMT-451: add ability to filter endpoint metadata based on presence of unenrolled events (elastic#69708)
  rename old siem kibana config to securitySolution (elastic#69874)
  Remove unused Resolver code (elastic#69914)
  [Observability] Fixing dynamic return type based on the appName (elastic#69894)
  [SECURITY SOLUTION][INGEST] Task/endpoint list tests (elastic#69419)
  Fixes special clicks and 3rd party icon sizes in nav (elastic#69767)
  [APM] Catch annotations index permission error and log warning (elastic#69881)
  [Endpoint][Ingest Manager] minor code cleanup (elastic#69844)
  [Logs UI] Logs ui context menu (elastic#69915)
  Index pattern serialize and de-serialize (elastic#68844)
  [QA] Unskip functional tests (elastic#69760)
  [SIEM][Detection Engine] - Update DE to work with new exceptions schema (elastic#69715)
  Fixes elastic#69639: Ignore url.url fields above 2048 characters (elastic#69863)
  PR: Provide limit warnings to user when API limits are reached. (elastic#69590)
  [Maps] Remove broken button (elastic#69853)
  Makes usage collection methods available on start (elastic#69836)
  [SIEM][CASE] Improve Jira's labelling (elastic#69892)
  [Logs UI] Access ML via the programmatic plugin API (elastic#68905)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usage collection methods should be available during start and not just during setup
3 participants