Open andy-root opened 1 week ago
Apply source maps to error stacks. Enabling this feature will make fetch calls for javascript source and map files. If these files are cross domain then CORS headers must be included in their responses. If credentials or other headers are required then an optional fetch function is included.
Error events will get handled by plugins that handle errors, these include Fetch, Error and Xhr. Before each plugin records an event it will convert the Error Event to a JS Error Event. This error processing is were the Rum Event is created and the error stack is truncated. This makes for a good location to process the error stack. If the RUM client config has sourceMapsEnabled then the error's stack will be parsed and replaced with a stack written from source maps.
Thanks so much for the awesome PR! I left a few high level questions and can definitely help close the gaps.
Of the three fatures:
stacktrace-js
- this seems very close to mergable. We need better documentation on the expected diff and value add. Also we need to validate things such as package size increase; and how large JSErrors will become with the additional info since there are hard backend limits. Comments on the Three features
For questions about local vs remote source maps, do you mean linked vs. inline? Minified js files will usually have source maps either linked at the end of the js file or the source map content will be included at the end of the js file. You either have 2 files, file.js and file.js.map or 1 larger js file that contains both the source and maps. In either case the change in size of the error stack will be the same.
FYI, I have our production apps using a similar design for applying sourcemaps with RUM and I increased our stacktraces from the default 1000 to 2000 through the RUM config.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.