Allow functions as backtrace matchers. Alongside regular expressions, you can also provide custom functions to match and replace paths in the backtrace:
JavaScript
const appsignal = new Appsignal({ // ... matchBacktracePaths: [(path) => { if (path.indexOf("/bundle/") !== -1) { return "bundle.js" } }]})
The function must take a backtrace line path as an argument. When the function returns a non-empty string, the string will be used as the path for that backtrace line. Otherwise, the path will be left unchanged.
Fixed
Fix matching on backtrace paths containing spaces.
When using matchBacktracePaths, when a backtrace line path contains a space, it will now match correctly against the whole path.
Add getters for spans. Use the getAction, getNamespace, getError, getTags, getParams, getBreadcrumbs, and getEnvironment methods to access data about the current span. This can be used to make decisions based on the span's properties within decorators or overrides.
Allow overrides to ignore spans. Within an override function, returning false will cause AppSignal to ignore the span.
Changed
Ignore spans by message after overrides. This allows overrides to modify error messages before ignoring them, allowing the override to cause the span to be ignored, or to prevent it from being ignored.
Deprecated
Deprecate @appsignal/core and @appsignal/types packages. Packages depending on these packages should be updated to use @appsignal/javascript instead.
Fixed
Use returned span in override. Fix an issue where the span returned from an override function was not being used, instead using the original span. This led to confusing behaviour when the override created a new span instead of modifying the original one.
To avoid breaking existing overrides that rely on modifying the original span without returning it, if the override function does not return a span, the original span will still be used.
Warning: This is an advanced feature meant for specific use cases. For most use cases, you should not need this functionality. If in doubt, leave matchBacktracePaths unset.
Using matchBacktracePaths will cause public sourcemap detection to fail. If using matchBacktracePaths, use our private sourcemap API to upload sourcemaps to AppSignal.
Some applications, such as those running on Electron or React Native environments, emit backtrace lines containing paths relative to the device in which the application is running.
The unpredictability of these backtrace line paths interferes with the correct functioning of backtrace error grouping, and makes it impossible to upload sourcemaps for these files using our private sourcemap API, as it is not possible to know the expected path beforehand.
You can set the matchBacktracePaths configuration to a list of one or more regexes, which will be used to attempt to match the relevant section of the backtrace line path.
For example, suppose you have an Electron application, which your users install at unpredictable locations. Your backtrace line paths may look something like this, with the username changing for each installation:
To ignore these parts of the path that are not predictable, you can configure AppSignal to ignore everything before the app folder as follows:
JavaScript
const appsignal = new AppSignal({ matchBacktracePaths: [ new RegExp("CoolBeans\\.app/Contents/Resources/(.*)$"), ],});
If set, the matchBacktracePaths configuration option must contain a regular expression, or an array of one or more regular expressions, which attempt to match the whole backtrace line path. These regular expressions must have one or more match groups, such as (.*) in the example above, which attempt to match against the relevant segments of the backtrace line path.
AppSignal will attempt to match the whole backtrace line path against these regular expressions in order. If any of the regular expression matches and produces a match group, AppSignal will replace the path in the backtrace line with the matched segment.
Make sure your regular expressions provide unique and stable points of reference in the path, such as CoolBeans.app/Contents/Resources in the example above.
Fixed
Fix an issue when regexes with the g global flag are used on ignoreErrors. Before this change, after successfully matching on an error to ignore, if the following error would also match the same regular expression, the regular expression would then fail to match it.
Remove error throw in development mode when sending an error with send/sendError.
The package is now useUnknownInCatchVariables compliant.
Try catch blocks in the package now check for the caught variable to be an instance of Error before doing any error-specific operations with it.
Add a span override prop to the ErrorBoundary and LegacyBoundary components.
Pass an override function to the error boundary component in order to set properties, such as tags, params or breadcrumbs, in the error span that will be sent to AppSignal.
The override function is only called when an error is about to be sent. This allows you to only perform expensive computation to add information to the error when an error will actually be reported.
When defined within a component, the function should be memoized with useCallback to prevent unnecessary re-renders:
Report the name for Vue 3 components built using composition. It will now report the component name, rather than [unknown Vue component] as the action name for an error.
The --config flag allows users to specify an AppSignal configuration file to use when running the diagnose command.
See the @appsignal/cli 1.2.4 changelog for more information.
Don’t let the bad bugs bite. Try AppSignal for free.
AppSignal offers a 30-day free trial, no credit card is required. All features are available in all plans. Start monitoring your application in just a few clicks!