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

[8.5] [Profiling] Add APIs to clear frame and executable caches (#145499) #145524

Merged
merged 2 commits into from
Nov 18, 2022

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.5:

Questions ?

Please refer to the Backport tool documentation

…5499)

This PR adds two endpoints to clear each respective cache:

* `DELETE {BASE_KIBANA_PATH}/api/profiling/v1/cache/executables`
* `DELETE {BASE_KIBANA_PATH}/api/profiling/v1/cache/stackframes`

Related to https://github.com/elastic/prodfiler/issues/2759

#### Design choices

1. The `DELETE` method was chosen instead of `PUT` or `POST` since the
given semantics of `DELETE` matches the expected behavior for the
related issue.
2. Each endpoint will remove all items from the respective cache. A
separate API for each cache allows us to selectively clear the necessary
cache without the downsides of a catch-all endpoint to clear all caches.
This gives us the flexibility to add more endpoints if needed. Given the
tradeoff between complexity now or later, it was decided to implement
general invalidation now with the option to invalidate specific items
later.
3. The RESTful design allows us to clear specific items later (e.g.
`DELETE {BASE_KIBANA_PATH}/api/profiling/v1/cache/executables/{ID}`
could clear only executable `ID` from the cache).
4. Each endpoint returns an empty payload on success. However, the
Kibana logs reflect the actions taken and how many cache items were
affected.
5. The stacktrace cache was ignored since it was not affected by symbols
written to Elasticsearch.
6. Each endpoint is not directly accessible from UI since it is expected
that the endpoints will be called outside of Kibana. However, the
endpoints can be called manually from the browser's console.

(cherry picked from commit 642ab74)
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
profiling 12.6KB 12.7KB +110.0B

History

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

cc @jbcrail

@kibanamachine kibanamachine merged commit 2902bf8 into elastic:8.5 Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants