Garbage collect old source maps uploaded to Kibana
- Dominant language
- Gherkin
- Stars
- 427
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
The APM app in Kibana provides an API for creating, listing, and deleting source maps: https://www.elastic.co/guide/en/kibana/current/rum-sourcemap-api.html
It is only possible to delete source maps one at a time. Particularly for users who automate uploading of source maps to Kibana, this both does not scale well, and requires too much manual intervention. For progressive rollouts there may not be an obvious time at which to remove old source maps.
**Describe the solution you'd like**
We should make it possible to query when a source map was last applied. This could be done either by storing the source map's ID in span and error documents, or by producing metrics similar to the metrics produced for tracking APM agent configuration -- probably the latter, for both document size and query performance.
Source maps should have an associated time-to-live (TTL): if a source map is not used within that time, then it will be automatically garbage collected by a scheduled task in Kibana. Users should be able to define a default source map TTL, and should also be able to override this default (or disable garbage collection altogether) when uploading a source map.
**Describe alternatives you've considered**
Provide an API to delete source maps older than X.
**Additional context**
https://github.com/elastic/apm-agent-rum-js/issues/1289#issuecomment-1278000466
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.