Download the PHP package rapidez/sentry without Composer
On this page you can find all versions of the php package rapidez/sentry. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rapidez/sentry
More information about rapidez/sentry
Files in rapidez/sentry
Package sentry
Short Description Sentry integration in Rapidez
License GPL-3.0
Homepage https://github.com/rapidez/sentry
Informations about the package sentry
Rapidez Sentry
This package integrates Sentry Laravel and Sentry Vue into a Rapidez project.
Installation
You will need to add the following lines to your .env:
You don't need the VITE_SENTRY_DSN line if you don't want to use the Sentry Vue package. Note that setting your Sentry DSN to be public like this is safe.
You can disable the Vue package in your .env by adding:
Configuration
You can publish the (vue-specific) config with:
Some basic configuration settings for Vue can also be set in your env, for example:
Check out the sentry/sentry-laravel readme for configuration of the laravel package.
Hooking into the beforeSend method
This package provides a way to hook into the beforeSend method by using the useBeforeSendHandlers store. This can be used in the following way:
Note that event handlers will be run in the order that they have been added, as changes made within these handlers need to be carried over.
To drop the event completely, you can return null. Note that this means you need to always return the event if you don't want it to be dropped.
Testing
Errors thrown directly from the browser console don't get caught by Sentry, so you can test whether or not the frontend error reporting works by sending a test error in the browser console with:
This functionality can be disabled in your .env:
Deprecating older browsers
You may end up having a lot of errors caused by people using really old browsers that don't support some more modern widely supported functions. To combat this, you can use the deprecations section in the configuration file:
Before initializing Sentry, this package will first check whether any of the given variables/functions are nullish (null or undefined). These are checked with window as the base variable.
If any of them end up being nullish, Sentry will not be loaded and frontend errors will not be logged.
Filtering errors
You can use the standard Sentry configuration for ignoreErrors as described in the sentry documentation.
This can be done in the configuration file like so:
Linking frontend errors to Magento Errors (Distributed Tracing)
For full observability you may want to connect your frontend errors and sessions to the thrown Magento errors. This could give benefits like showing where in a Replay an error occurred in Magento.
For this you must first install the Magento2 Sentry module
Then add the following to your Rapidez .env
With this enabled you must make sure the sentry-trace,baggage,traceparent headers are allowed in your Magento (and if applicable Rapidez) CORS config
Then in Magento make sure to enable "Tracing", "Performance tracking", and to set a "Traces sample rate" (0 is allowed)
With this set up your Rapidez and Magento Sentry should be linked with each other.
Record network details
By default Sentry blocks all text, inputs, images and request/response bodies: https://docs.sentry.io/platforms/javascript/session-replay/privacy/#privacy-configuration
If you want to change this behaviour, you can override these in config/sentry-vue.php
By setting "networkDetailAllowUrls" the request bodies and responses will be reported as well. This means some personal information could be sent over. We have a sanitizer in place to reduce the impact. You can extend the values filtered out with the following .env variables
License
GNU General Public License v3. Please see License File for more information.