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

PR: Provide limit warnings to user when API limits are reached. #69590

Merged
merged 8 commits into from
Jun 25, 2020
Merged

PR: Provide limit warnings to user when API limits are reached. #69590

merged 8 commits into from
Jun 25, 2020

Conversation

bkimmel
Copy link
Contributor

@bkimmel bkimmel commented Jun 18, 2020

Summary

The goal of this PR is to provide the GTV with facilities to warn users when API limits are reached/exceeded so they know there is more information present than what the GTV can show them.

Notes

  1. Reading nextChild and nextAncestor off of the request in middleware to detect if we hit a limit or not.
  2. Reviewed the basic plan for this PR with the team: We're going to surface the "bare minimum" information for the user to know when they've reached a limit on either (anestors, children, relateds).
  3. Design will decide later how to display this information to the user, the intention of this PR is to make it available on state.
  4. Added selectors and tests.
  5. Related event data is already exposed to the UI through the response from the middleware

@@ -77,15 +77,19 @@ export const resolverMiddlewareFactory: MiddlewareFactory = (context) => {
}
const nodeStats: Map<string, ResolverNodeStats> = new Map();
nodeStats.set(entityId, stats);
const limitReached = children.nextChild !== null || ancestry.nextAncestor !== null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonathan-buttner does this seem right to you? If either nextChild or nextAncestor isn't null we know we didn't get all the stuff, right? Is there a similar thing for lifecycle?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah my bad @bkimmel totally missed this. So the thing to note is that we're only requesting the default amount for the API. I wonder if we should always request the max?

As for lifecycle in the backend we're operating under the assumption that we'll always be able to retrieve all the lifecycle nodes for the entire request. We may have to address fixing that later though but for now there's no nextLifecycle.

@bkimmel bkimmel marked this pull request as ready for review June 24, 2020 14:25
@bkimmel bkimmel requested review from a team as code owners June 24, 2020 14:25
@bkimmel bkimmel added v7.9.0 v8.0.0 Team:Endpoint Data Visibility Team managing the endpoint resolver labels Jun 24, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-data-visibility-team (Team:Endpoint Data Visibility)

@bkimmel bkimmel added release_note:skip Skip the PR/issue when compiling release notes Feature:Resolver Security Solution Resolver feature labels Jun 24, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-app-team (Feature:Resolver)

@bkimmel bkimmel added the Feature:Endpoint Elastic Endpoint feature label Jun 24, 2020
@bkimmel
Copy link
Contributor Author

bkimmel commented Jun 24, 2020

@elasticmachine merge upstream

@bkimmel bkimmel changed the title Draft: Provide limit warnings to user when API limits are reached. PR: Provide limit warnings to user when API limits are reached. Jun 24, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@bkimmel
Copy link
Contributor Author

bkimmel commented Jun 25, 2020

@bkimmel bkimmel merged commit 0ef7bb8 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)
  ...
@bkimmel bkimmel deleted the gtv/limit-warnings branch June 25, 2020 14:15
oatkiller pushed a commit to oatkiller/kibana that referenced this pull request Jun 25, 2020
…tic#69590)

* Provide facilties to raise limit warnings for user when API limits are reached.
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)
  ...
bkimmel added a commit that referenced this pull request Jun 25, 2020
…) (#69944)

* Provide facilties to raise limit warnings for user when API limits are reached.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Endpoint Elastic Endpoint feature Feature:Resolver Security Solution Resolver feature release_note:skip Skip the PR/issue when compiling release notes Team:Endpoint Data Visibility Team managing the endpoint resolver v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants