Giter Site home page Giter Site logo

magento2-sentry's Introduction

Magento 2 Sentry Logger

This Magento 2 module integrates the Sentry sdk into magento 2. Depending on the log level configured in the backend of magento 2, notifications and errors can be send to sentry.

Installation

  • composer require justbetter/magento2-sentry
  • bin/magento module:enable JustBetter_Sentry
  • bin/magento setup:upgrade
  • bin/magento setup:di:compile
  • bin/magento setup:static-content:deploy

Configuration

For configuration with Adobe Cloud, check below.

This module uses the Magento Deployment Configuration for most it's configuration. This means that you need to add this array to your app/etc/env.php:

'sentry' => [
    'dsn' => 'example.com',
    'logrocket_key' => 'example/example',
    'environment' => null,
    'log_level' => \Monolog\Logger::WARNING,
    'errorexception_reporting' => E_ALL,
    'ignore_exceptions' => [],
    'mage_mode_development' => false,
    'js_sdk_version' => \JustBetter\Sentry\Block\SentryScript::CURRENT_VERSION,
    'tracing_enabled' => true, 
    'tracing_sample_rate' => 0.5,
    'ignore_js_errors' => []
]

Next to that there are some configuration options under Stores > Configuration > JustBetter > Sentry.

Configuration values

  • dsn: Please enter here the DSN you got from Sentry for your project. You can find the DSN in the project settings under "Client Key (DSN)"
  • environment: Here you can specify the environment under which the deployed version is running. Common used environments are production, staging, and development. With this option you can differentiate between errors which happen on the staging and i.e. on the production system
  • log_level: With this configuration you can specify from which logging level on Sentry should get the messages
  • errorexception_reporting: If the Exception being thrown is an instance of ErrorException send the error to sentry if it matches the error reporting. This uses the same syntax as Error Reporting eg. E_ERROR | E_WARNING to only log Errors and Warnings.
  • ignore_exceptions: If the class being thrown matches any in this list do not send it to Sentry e.g. [\Magento\Framework\Exception\NoSuchEntityException::class]
  • mage_mode_development: If this option is set to true you will receive issues in Sentry even if you're Magento is running in develop mode.
  • js_sdk_version: if this option is set, it will load the explicit version of the javascript SDK of Sentry.
  • tracing_enabled if this option is set to true, tracing got enabled (bundle file got loaded automatically). Default: false
  • tracing_sample_rate if tracing is enabled, you should also set the sample rate. Default: 0.2
  • ignore_js_errors array of javascript error messages, which should be not send to Sentry. (see also ignoreErrors in Sentry documentation)

Configuration for Adobe Cloud

Since Adobe Cloud doesn't allow you to add manually add content to the env.php file, the configuration can be done using the "Variables" in Adobe Commerce using the following variables:

  • CONFIG__SENTRY__ENVIRONMENT__ENABLED: boolean
  • CONFIG__SENTRY__ENVIRONMENT__DSN: string
  • CONFIG__SENTRY__ENVIRONMENT__LOGROCKET_KEY: string
  • CONFIG__SENTRY__ENVIRONMENT__ENVIRONMENT: string
  • CONFIG__SENTRY__ENVIRONMENT__LOG_LEVEL: integer
  • CONFIG__SENTRY__ENVIRONMENT__ERROREXCEPTION_REPORTING: integer
  • CONFIG__SENTRY__ENVIRONMENT__IGNORE_EXCEPTIONS: A JSON encoded array of classes
  • CONFIG__SENTRY__ENVIRONMENT__MAGE_MODE_DEVELOPMENT: string
  • CONFIG__SENTRY__ENVIRONMENT__JS_SDK_VERSION: string
  • CONFIG__SENTRY__ENVIRONMENT__TRACING_ENABLED: boolean
  • CONFIG__SENTRY__ENVIRONMENT__TRACING_SAMPLE_RATE: float
  • CONFIG__SENTRY__ENVIRONMENT__IGNORE_JS_ERRORS: A JSON encoded array of error messages

The following configuration settings can be overridden in the Magento admin. This is limited to ensure that changes to particular config settings can only be done on server level and can't be broken by changes in the admin.

Optional error page configuration

  • Optional you can configure custom error pages in pub/errors. You can use the sentry feedback form and insert here the sentry log ID. The Sentry Log Id is captured in de customer session and can be retrieved in processor.php.

Sending additional data to Sentry when logging errors

  • When calling any function from the Psr\Log\LoggerInterface you can pass any data to the parameter $context and it will be send to Sentry as 'Custom context'.

Change / Filter events

This module has an event called sentry_before_send that is dispatched before setting the config before_send. This provides the means to edit / filter events. You could for example add extra criteria to determine if the exception should be captured to Sentry. To prevent the Exception from being captured you can set the event to null or unset it completly.

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $observer->getEvent()->getSentryEvent()->unsEvent();
}

Compatibility

The module is tested on Magento version 2.4.x with sentry sdk version 3.x. Magento 2.1.x is not supported by us anymore, feel free to fork this project or make a pull request.

Ideas, bugs or suggestions?

Please create a issue or a pull request.

About us

We’re a innovative development agency from The Netherlands building awesome websites, webshops and web applications with Laravel and Magento. Check out our website justbetter.nl and our open source projects.

License

MIT


JustBetter logo

magento2-sentry's People

Contributors

adamj88 avatar arjenmiedema avatar boldbart avatar cirolosapio avatar dominicwatts avatar erikhansen avatar fredden avatar indykoning avatar jeroenboersma avatar jketelaar avatar josephmaxwell avatar jupiterhs avatar kyriog avatar matthiashamacher avatar michielgerritsen avatar netzkollektiv avatar oneserv-heuser avatar peterjaap avatar rakibabu avatar rbnmulder avatar rommelfreddy avatar royduin avatar stylecibot avatar t9toqwerty avatar torhoehn avatar vincentbean avatar xigendominic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento2-sentry's Issues

insanity logging levels

Default logging level is absolute insanity, and sould probably be removed altogether.

This caused our sentry account to hit it's quota of events within a few page loads. Sending thousands of log entries per page load into a system meant to exception logging is crazy.

Enable or Disable Php Error Tracking

Feature: What is your use case for such a feature?

There is no way to disable Php error tracking. This feature will give store admin more flexibility to enable any or both of Php & Javascript error tracking.

What are the equivalent environment variable names for the settings placed in env.php

Hi,

Does anyone know what the names of the environment variables are that will be used to populate the fields normally defined in env.php for this intergration? Sadly I do not know much about Magento and while I have been able to decode the docs well enough to set certain system wide default web values I do not understand things well enough to work out the names that will map to the Sentry settings.

As an example to provide some context. In the database there is a value stored for the "Web Secure Base URL" which provides the URL that a deployment will use when refering to the site. This can be set by using

CONFIG__DEFAULT__WEB__SECURE__BASE_URL

It is a great way to setup CI systems and docker based deployments, but as I have noted the docs are somewhat light on information, I guess developers just go and read the source code, but my background is OPS, not development.

Thanks

Feature request: Add JS error tracking + logrocket integration to adminhtml area

At the moment JS error tracking is only working in the frontend (same for logrocket integration).
I'd love to have the error tracking and logrocket integration (with user identification based on logged in adminhtml user) added to the adminhtml area.

That would be a real game changer for us in error tracking.

Is it possible to add this feature? That would be really nice!

Bug: wrong product link if groups[seo][fields][product_use_categories][value] = 0

Today we tested the module under Magento 2.4.4 with PHP 7.4, we noticed that if "Use Categories Path for Product URLs" is disabled + multistore the product links within the categories are not correct in the frontend.

Output without PHP tracking:
domain.com/en/category/subcategory
domain.com/en/product-item-url

Output with PHP tracking:
domain.com/en/category/product-item-url

Add LogRocket integration

It would be great to have LogRocket integration in the extension, see https://blog.logrocket.com/extending-sentry-with-logrocket-52e2f5b67d5a/

Two bits of code should be added;

Right after :

<script src="https://cdn.lr-ingest.io/LogRocket.min.js" crossorigin="anonymous"></script>
<script>window.LogRocket && window.LogRocket.init('INITKEY_HERE');</script>

Before :

LogRocket.getSessionURL(sessionURL => {
  Sentry.configureScope(scope => {
    scope.setExtra("sessionURL", sessionURL);
  });
});

We'll need to add two configuration opties; Enable/disable LogRocket integration, and an input field for the LogRocket init key (which you'll get when you create a project in LogRocket).

Codestyling

To enforce codestyling, project should utilize phpcsfixer. I will be implementing this into develop branch after #26 has been merged.

Install Error: Circular dependency

Circular dependency: JustBetter\Sentry\Plugin\MonologPlugin depends on Magento\Framework\App\Helper\Context and vice versa.#0 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('JustBetter\\Sent...')
#1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('JustBetter\\Sent...')
#2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Psr\\Log\\LoggerI...', NULL, 'logger', 'Magento\\Framewo...')
#3 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#4 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#5 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#6 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#7 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'context', 'JustBetter\\Sent...')
#8 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('JustBetter\\Sent...', Array, Array)
#9 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('JustBetter\\Sent...', Array, Array)
#10 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('JustBetter\\Sent...')
#11 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('JustBetter\\Sent...')
#12 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'JustBetter\\Sent...', NULL, 'data', 'JustBetter\\Sent...')
#13 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('JustBetter\\Sent...', Array, Array)
#14 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('JustBetter\\Sent...', Array, Array)
#15 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('JustBetter\\Sent...')
#16 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('JustBetter\\Sent...')
#17 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Psr\\Log\\LoggerI...', NULL, 'logger', 'Magento\\Framewo...')
#18 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#19 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#20 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#21 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#22 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'logger', 'Magento\\Framewo...')
#23 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#24 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#25 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#26 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(197): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#27 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(161): Magento\Framework\App\Cache\Frontend\Factory->_applyDecorators(Object(Magento\Framework\Cache\Frontend\Decorator\TagScope))
#28 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Pool.php(67): Magento\Framework\App\Cache\Frontend\Factory->create(Array)
#29 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Pool.php(146): Magento\Framework\App\Cache\Frontend\Pool->_initialize()
#30 /var/www/html/vendor/magento/framework/App/Cache.php(38): Magento\Framework\App\Cache\Frontend\Pool->get('default')
#31 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(116): Magento\Framework\App\Cache->__construct(Object(Magento\Framework\App\Cache\Frontend\Pool))
#32 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#33 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#34 /var/www/html/vendor/magento/framework/App/Cache/Proxy.php(44): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#35 /var/www/html/vendor/magento/framework/App/Cache/Proxy.php(67): Magento\Framework\App\Cache\Proxy->_getCache()
#36 /var/www/html/vendor/magento/framework/App/ProductMetadata.php(80): Magento\Framework\App\Cache\Proxy->load('mage-version')
#37 /var/www/html/vendor/magento/framework/Console/Cli.php(92): Magento\Framework\App\ProductMetadata->getVersion()
#38 /var/www/html/bin/magento-php(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#39 {main}

Latest 2.2.1

Magento 2.3.3
PHP 7.2

Add user info to error log when user is logged in

Do you want to request a feature or report a bug?

request feature

Feature: What is your use case for such a feature?

I need to know with whom the error happened such that I can be able to proactively contact the user and request more info or let them know they should update the app somehow.

Feature: What is your proposed configuration entry? The new option to add? What is the behavior?

When the user is logged in use Raven.setUser() and include the logged in user details there

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.

Magento 2.3.1
Magento2Sentry 0.7.2

Ability to set Raven options

The url that is sent to sentry is incorrect in our setup. Our Apache web server is running on port 30000, in our AWS ELB we forward ports 80 and 443 to 30000 (for load balancing and SSL offload). When an exception occurs, the correct domain is sent, but it is including the internal port.

Magento: 2.2.6
"justbetter/magento2-sentry": "0.4.2"

image

Circular dependency in 2.1.0

Magento 2.3.3
magento2-sentry 2.1.0

php bin/magento app:config:dump
Circular dependency: JustBetter\Sentry\Plugin\MonologPlugin depends on Magento\Framework\App\Helper\Context and vice versa.#0 /data/clientname/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Just
Better\\Sent...')
#1 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('JustBetter\\Sent...')
#2 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Psr\\Log\\LoggerI...', NULL, 'logger', 'Magento\\Framewo...')
#3 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#4 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#5 /data/clientname/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#6 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#7 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'context', 'JustBetter\\Sent...')
#8 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('JustBetter\\Sent...', Array, Array)
#9 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('JustBetter\\Sent...', Array, Array)
#10 /data/clientname/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('JustBetter\\Sent...')
#11 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('JustBetter\\Sent...')
#12 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'JustBetter\\Sent...', NULL, 'data', 'JustBetter\\Sent...')
#13 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('JustBetter\\Sent...', Array, Array)
#14 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('JustBetter\\Sent...', Array, Array)
#15 /data/clientname/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('JustBetter\\Sent...')
#16 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('JustBetter\\Sent...')
#17 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Psr\\Log\\LoggerI...', NULL, 'logger', 'Magento\\Framewo...')
#18 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#19 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#20 /data/clientname/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#21 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#22 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'logger', 'Magento\\Framewo...')
#23 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#24 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#25 /data/clientname/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#26 /data/clientname/magento2/vendor/magento/framework/App/Cache/Frontend/Factory.php(197): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#27 /data/clientname/magento2/vendor/magento/framework/App/Cache/Frontend/Factory.php(161): Magento\Framework\App\Cache\Frontend\Factory->_applyDecorators(Object(Magento\Framework\Cache\Frontend\Decorator\TagScope))
#28 /data/clientname/magento2/vendor/magento/framework/App/Cache/Frontend/Pool.php(67): Magento\Framework\App\Cache\Frontend\Factory->create(Array)
#29 /data/clientname/magento2/vendor/magento/framework/App/Cache/Frontend/Pool.php(146): Magento\Framework\App\Cache\Frontend\Pool->_initialize()
#30 /data/clientname/magento2/vendor/magento/framework/App/Cache.php(38): Magento\Framework\App\Cache\Frontend\Pool->get('default')
#31 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(116): Magento\Framework\App\Cache->__construct(Object(Magento\Framework\App\Cache\Frontend\Pool))
#32 /data/clientname/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#33 /data/clientname/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#34 /data/clientname/magento2/vendor/magento/framework/App/Cache/Proxy.php(44): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#35 /data/clientname/magento2/vendor/magento/framework/App/Cache/Proxy.php(67): Magento\Framework\App\Cache\Proxy->_getCache()
#36 /data/clientname/magento2/vendor/magento/framework/App/ProductMetadata.php(80): Magento\Framework\App\Cache\Proxy->load('mage-version')
#37 /data/clientname/magento2/vendor/magento/framework/Console/Cli.php(92): Magento\Framework\App\ProductMetadata->getVersion()
#38 /data/clientname/magento2/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#39 {main}

Script tag included regardless of admin configuration for enabling it

Do you want to request a feature or report a bug?

bug

Bug: What is the current behavior?

Script tag is included when admin configuration "Enable Sentry script tag" is set to 'No'

Bug: What is the expected behavior?

Script tag respects admin config

Bug: What is the proposed solution?

Update Helper/Data.php to correctly use admin configuration.

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.

Magento 2.3.3 and Justbetter Sentry v2.2.1

** More Detail **

Believe it was this change which introduced it: 1f60b01#diff-735f70c1f948ebbd90915b1548d93432R161

Ability to send test event

Would be good to have a button to send a test event to Sentry to make sure its all working correctly. Often extensions like SMTP email have this and its very useful.

Implement PHPCSFixer

To keep codestyling same everywhere, we should utilize PHPCSFixer which will perform automatically fixes into code style. Example configuration will be posted via PR.

Release number is int, not string

Version 2.0.0

Exception #0 (Symfony\Component\OptionsResolver\Exception\InvalidOptionsException): The option "release" with value 1576503498 is expected to be of type "null" or "string", but is of type "integer".
cat pub/static/deployed_version.txt 
1576503498%                                                    

Should be cast to string before returning it to sentry SDK I guess..

Ignore static version in issue grouping?

Everytime we do a new deploy, we suddenly see a spike in frontend errors. When I dove deeper into this, I noticed this is because after a deploy the static version signing URL is changed, and Sentry thinks it is a new issue (because new URL).

The same problem appears for different storeviews. These URLs are now seen as individual URLs while they should be grouped imho;

ReferenceError if(version1606832327/frontend/Elgentos/client/en_US/knockoutjs/knockout)
ReferenceError if(version1606832327/frontend/Elgentos/client/en_GB/knockoutjs/knockout)
ReferenceError if(version1606832327/frontend/Elgentos/client/nl_NL/knockoutjs/knockout)
ReferenceError if(version1606832327/frontend/Elgentos/client/de_DE/knockoutjs/knockout)

ReferenceError if(version1606832123/frontend/Elgentos/client/en_US/knockoutjs/knockout)
ReferenceError if(version1606832123/frontend/Elgentos/client/en_GB/knockoutjs/knockout)
ReferenceError if(version1606832123/frontend/Elgentos/client/nl_NL/knockoutjs/knockout)
ReferenceError if(version1606832123/frontend/Elgentos/client/de_DE/knockoutjs/knockout)

Is there a way to make Sentry ignore these parts of the URL when fingerprinting? I've read their docs on fingerprint but can't find anything regarding this. Or maybe we could adjust the extension so it strips out these parts (probably by introducing a new config option that is disabled by default)?

ErrorException in Version 2.5.0

ErrorException
Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead

Unbenannt

Update causes Nginx Error '104: Connection reset by peer while reading response header from upstream'

We run a Magneto 2.2.6 Shop and wanted to update the sentry extension to a newer version. We used the 0.6.2 version too long. Composer installed the version 2.2.3.

After that we got some times the Http Error 502 'Bad Gateway'. It was caused bei an nginx error (104: Connection reset by peer while reading response header from upstream) that was caused by an exiting php.

Because the error is not easiliy repeated, we wrote a random test to verify it.

So on PHP 7.1 with Magento 2.2.6 the problem is there and bad because whole pages are not delivered.

We tried to find the cause of the problem also with the help of our hoster but with no results.

With Magento 2.3.2 and PHP 7.3 the problem is gone. So we will concentrate on that.

Admin system configuration slowdown when saving config value

Magento 2.3.2 vanilla using luma theme. Very few customisations.

I noticed today on a dev install as soon as sentry extension is enabled when you click save in system configuration you experience slowdown

I've done a bit of profiling and it's not MySQL. MySQL sleep processes stack up whilst waiting on the application.

php-fpm appears to be hanging on something. But I can't pinpoint it to anything particular. New relic simply indicates an increase in response time

It's the difference between a 5 - 10 second save and a 20 - 30 second save

Of course this could be expected behaviour

Setup:DI:Compile Incompatible argument type

Interception cache generation... 6/7 [========================>---] 85% 29 secs 290.0 MiB

Errors during compilation:
Magestore\Bannerslider\Model\ResourceModel\Banner\Collection
Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Magento\Framework\Model\ResourceModel\Db\AbstractDb; File:
[PWD]/vendor/magestore/module-bannerslider/Model/ResourceModel/Banner/Collection.php

Total Errors Count: 1

[Magento\Framework\Validator\Exception]
Error during compilation

===========

I tried to install it to Magento 2.2.3

Upgrade to Sentry API v2 + exception handling?

Feature: What is your use case for such a feature?
I am comparing Rollbar vs Sentry and am seeing that Rollbar (while very basic) has good root-level exception handling. This is quite important, and seems to be missing from Sentry (just log publishing).

However, the v2 of the Sentry API has much better exception handling.

Are you open to pull requests? Or, are you already working on such an implementation?

I am using the Magento 2.3.2 with the latest version of this module.

Javascript error missing environment variable

In Sentry with PHP errors we have the correct value in enviroment tag. But for Javascript errors, the environment tag is not there. It makes it difficult to trace them in our different enviroments.

Do you have a solution to it?

Could not connect to sentry

Do you want to request a feature or report a bug?

Bug: What is the current behavior?

Bug: What is the expected behavior?

Bug: What is the proposed solution?

Feature: What is your use case for such a feature?

Feature: What is your proposed configuration entry? The new option to add? What is the behavior?

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.

Your requirements could not be resolved to an installable set of packages.

When I try to install justbetter/magento2-sentry ^0.3.0 with composer in Magento 2.2.4 I get an error. The same error occurs when requiring the dev/master version.

The error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for justbetter/magento2-sentry ^0.3.0 -> satisfiable by justbetter/magento2-sentry[0.3.0].
    - justbetter/magento2-sentry 0.3.0 requires magento/framework * -> no matching package found.
  • I can see the justbetter/magento2-sentry composer .json requires "magento/framework": "*"
  • All Magento core packages and a lot of other packages also require magento/framework and composer installing them does not throw an error
  • The only obvious difference I can spot is that these packages all require a specific version, e.g. "magento/framework": "100.1.*|101.0.*" or "magento/framework": "101.0.*"

Ability to set Magento modes that send errors to Sentry

Currently errors are only sent to Sentry if Magento is in production mode. That's great for when the site is running, but not helpful during development. There should be an admin setting to allow for errors to be sent for any/all Magento modes.

Compatibility with Magento Cloud

Hey guys!

I really like this extension I would love to use it on Magento cloud projects but I found a big blocker. You are using DeploymentConfig to get all the configuration sentry settings. The problem with that is you are recollecting these options either from env.php or config.php. For on-premise projects is not a big issue to add all the settings into the env.php file but for Magento Cloud projects isn't possible.

Magento Cloud recommends using environment variables to override settings like CONFIG__DEFAULT__SENTRY__DSN which in this case is not an option because the extension is using Magento Deployment Configuration.

I just forked your project and I would love to propose one of two solutions.

  • Treat the settings as module configuration.
  • Change the approach and accept environment variables as well.

What do you think?

v0.6.0: Exception thrown when opening config in backend

I just installed the module for the first time. The installation had no errors but when i open the module config in the backend (path admin/system_config/edit/section/sentry/) i get this error message:

1 exception(s):
Exception #0 (ReflectionException): Class JustBetter\Sentry\Model\Config\Source\ScriptTagPlacement does not exist

Exception #0 (ReflectionException): Class JustBetter\Sentry\Model\Config\Source\ScriptTagPlacement does not exist
#0 /var/www/public/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('JustBetter\\Sent...')
#1 /var/www/public/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('JustBetter\\Sent...')
#2 /var/www/public/vendor/magento/framework/ObjectManager/Factory/Compiled.php(100): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('JustBetter\\Sent...')
#3 /var/www/public/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('JustBetter\\Sent...')
#4 /var/www/public/vendor/magento/module-config/Model/Config/SourceFactory.php(37): Magento\Framework\ObjectManager\ObjectManager->get('JustBetter\\Sent...')
#5 /var/www/public/vendor/magento/module-config/Model/Config/Structure/Element/Field.php(440): Magento\Config\Model\Config\SourceFactory->create('JustBetter\\Sent...')
#6 /var/www/public/vendor/magento/module-config/Model/Config/Structure/Element/Field.php(376): Magento\Config\Model\Config\Structure\Element\Field->_getOptionsFromSourceModel('JustBetter\\Sent...')
#7 /var/www/public/vendor/magento/module-config/Block/System/Config/Form.php(404): Magento\Config\Model\Config\Structure\Element\Field->getOptions()
#8 /var/www/public/vendor/magento/module-config/Block/System/Config/Form.php(325): Magento\Config\Block\System\Config\Form->_initElement(Object(Magento\Config\Model\Config\Structure\Element\Field\Interceptor), Object(Magento\Framework\Data\Form\Element\Fieldset), 'sentry/general/...', '', '')
#9 /var/www/public/vendor/magento/module-config/Block/System/Config/Form.php(265): Magento\Config\Block\System\Config\Form->initFields(Object(Magento\Framework\Data\Form\Element\Fieldset), Object(Magento\Config\Model\Config\Structure\Element\Group\Interceptor), Object(Magento\Config\Model\Config\Structure\Element\Section))
#10 /var/www/public/vendor/magento/module-config/Block/System/Config/Form.php(211): Magento\Config\Block\System\Config\Form->_initGroup(Object(Magento\Config\Model\Config\Structure\Element\Group\Interceptor), Object(Magento\Config\Model\Config\Structure\Element\Section), Object(Magento\Framework\Data\Form))
#11 /var/www/public/vendor/magento/module-config/Block/System/Config/Form.php(548): Magento\Config\Block\System\Config\Form->initForm()
#12 /var/www/public/vendor/magento/framework/View/Element/AbstractBlock.php(666): Magento\Config\Block\System\Config\Form->_beforeToHtml()
#13 /var/www/public/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Element\AbstractBlock->toHtml()
#14 /var/www/public/vendor/magento/framework/View/Layout.php(533): Magento\Framework\View\Layout->_renderBlock('system\\config\\f...')
#15 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('system\\config\\f...')
#16 /var/www/public/vendor/magento/framework/View/Element/AbstractBlock.php(507): Magento\Framework\View\Layout->renderElement('system\\config\\f...', true)
#17 /var/www/public/vendor/magento/module-config/view/adminhtml/templates/system/config/edit.phtml(22): Magento\Framework\View\Element\AbstractBlock->getChildHtml('form')
#18 /var/www/public/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/public...')
#19 /var/www/public/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Config\Block\System\Config\Edit), '/var/www/public...', Array)
#20 /var/www/public/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/var/www/public...')
#21 /var/www/public/vendor/magento/module-backend/Block/Template.php(126): Magento\Framework\View\Element\Template->_toHtml()
#22 /var/www/public/vendor/magento/framework/View/Element/AbstractBlock.php(667): Magento\Backend\Block\Template->_toHtml()
#23 /var/www/public/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Element\AbstractBlock->toHtml()
#24 /var/www/public/vendor/magento/framework/View/Layout.php(533): Magento\Framework\View\Layout->_renderBlock('system.config.e...')
#25 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('system.config.e...')
#26 /var/www/public/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('system.config.e...', false)
#27 /var/www/public/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('content', false)
#28 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('content')
#29 /var/www/public/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('content', false)
#30 /var/www/public/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('admin.scope.col...', false)
#31 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('admin.scope.col...')
#32 /var/www/public/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('admin.scope.col...', false)
#33 /var/www/public/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('main.col', false)
#34 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('main.col')
#35 /var/www/public/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('main.col', false)
#36 /var/www/public/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('page.main.conta...', false)
#37 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('page.main.conta...')
#38 /var/www/public/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('page.main.conta...', false)
#39 /var/www/public/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('page.content', false)
#40 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('page.content')
#41 /var/www/public/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('page.content', false)
#42 /var/www/public/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false)
#43 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#44 /var/www/public/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('page.wrapper', false)
#45 /var/www/public/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('backend.page', false)
#46 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('backend.page')
#47 /var/www/public/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('backend.page', false)
#48 /var/www/public/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('root', false)
#49 /var/www/public/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('root')
#50 /var/www/public/vendor/magento/framework/View/Layout.php(954): Magento\Framework\View\Layout->renderElement('root')
#51 /var/www/public/generated/code/Magento/Framework/View/Layout/Interceptor.php(37): Magento\Framework\View\Layout->getOutput()
#52 /var/www/public/vendor/magento/framework/View/Result/Page.php(257): Magento\Framework\View\Layout\Interceptor->getOutput()
#53 /var/www/public/vendor/magento/framework/View/Result/Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#54 /var/www/public/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#55 /var/www/public/vendor/magento/framework/App/Http.php(139): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#56 /var/www/public/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()
#57 /var/www/public/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#58 {main}

The error seems to be the new field script_tag_placement. When i remove it from justbetter/magento2-sentry/etc/adminhtml/system.xml and clear the cache, the error is gone.

Possible bug - php-http/async-client-implementation requirement could not be resolved

When I try installing magento2-sentry 2.1.0 on magento 2.3.3, i get a requirements error for php-http/async-client-implementation.
I am using the command
composer require justbetter/magento2-sentry

Possible Solution: I think that an implementation of php-http/async-client-implementation should be included in the magento2-sentry composer.json. Similar to how psr/http-message-implementation, nyholm/psr7 has been included. What do you think?

Below is the complete error


Your requirements could not be resolved to an installable set of packages.
Problem 1
  - sentry/sentry 2.2.4 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.2.3 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.2.2 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.2.1 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.2.0 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.1.3 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.1.2 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.1.1 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.1.0 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.0.1 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - sentry/sentry 2.0.0 requires php-http/async-client-implementation ^1.0 -> no matching package found.
  - justbetter/magento2-sentry 2.1.0 requires sentry/sdk ^2.0 -> satisfiable by sentry/sdk[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4].
  - sentry/sdk 2.0.4 requires sentry/sentry ^2.1.3 -> satisfiable by sentry/sentry[2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4].
  - sentry/sdk 2.0.2 requires sentry/sentry ^2.0.1 -> satisfiable by sentry/sentry[2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4].
  - sentry/sdk 2.0.3 requires sentry/sentry ^2.0.1 -> satisfiable by sentry/sentry[2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4].
  - sentry/sdk 2.0.0 requires sentry/sentry ^2.0 -> satisfiable by sentry/sentry[2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4].
  - sentry/sdk 2.0.1 requires sentry/sentry ^2.0 -> satisfiable by sentry/sentry[2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4].
  - Installation request for justbetter/magento2-sentry ^2.1 -> satisfiable by justbetter/magento2-sentry[2.1.0].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
 see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Option to enable & disable the functionality in Magento Admin

Feature: What is your use case for such a feature?

Right now to stop Sentry error tracking we have to disable the module for which one needs to be comfortable with the command line and have basic knowledge about Magento. It will be good if we can have the functionality to disable or enable from Magento Admin so that store admin can do this without having to connect with the developer.

Feature: What is your proposed configuration entry? The new option to add? What is the behavior?

We can use enable_sentry configuration entry.

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.
We are using 2.3.0.

Add check for ErrorException severity

Feature: What is your use case for such a feature?
Add an extra configuration field that for the minimum severity level before the exception gets logged to Sentry.
This can be any of these constants
https://www.php.net/manual/en/errorfunc.constants.php

The only issue is, the getSeverity function is only available in ErrorException objects https://www.php.net/manual/en/errorexception.getseverity.php

so it may not work for all exceptions.

This allows us to ignore "Info" ErrorExceptions if needed without overwriting the error_reporting and stopping Magento or other modules from logging this.

Feature: What is your proposed configuration entry? The new option to add? What is the behavior?

'sentry' => [
    'dsn' => 'example.com',
    'logrocket_key' => 'example/example',
    'environment' => null,
    'log_level' => \Monolog\Logger::WARNING,
    // The new exception_level
    'errorexception_level' => E_WARNING
    'mage_mode_development' => false,
]

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.
Magento: 2.4.1
Sentry: 2.5.4

PHP 8.1 support

After install this extension on Magento 2.4.4 with PHP 8.1 (with --ignore-platform-reqs composer flag), I'm getting this error when running bin/magento setup:upgrade;

PHP Fatal error:  Declaration of JustBetter\Sentry\Plugin\MonologPlugin::addRecord($level, $message, array $context = []) must be compatible with Monolog\Logger::addRecord(int $level, string $message, array $context = []): bool in /data/client/magento2/vendor/justbetter/magento2-sentry/Plugin/MonologPlugin.php on line 54

Area code is already set

Issues with Magento 2.2.5.

installed via composer

"justbetter/magento2-sentry": "^0.4.1"

Random errors pop up, for example when generating a sitemap, or cache flushed.

'Area code is already set'

stack trace:

#0 Magento\Framework\App\State->setAreaCode() called at [/var/www/html/vendor/justbetter/magento2-sentry/Helper/Data.php:62] #1 JustBetter\Sentry\Helper\Data->__construct() called at [/var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111] #2 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() called at [/var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php:108] #3 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [/var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70] #4 Magento\Framework\ObjectManager\ObjectManager->get() called at [/var/www/html/generated/code/JustBetter/Sentry/Helper/Data/Proxy.php:84] #5 JustBetter\Sentry\Helper\Data\Proxy->_getSubject() called at [/var/www/html/generated/code/JustBetter/Sentry/Helper/Data/Proxy.php:119] #6 JustBetter\Sentry\Helper\Data\Proxy->isActive() called at [/var/www/html/vendor/justbetter/magento2-sentry/Plugin/MonologPlugin.php:44] #7 JustBetter\Sentry\Plugin\MonologPlugin->addRecord() called at [/var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php:532] #8 Monolog\Logger->debug() called at [/var/www/html/vendor/magento/framework/Cache/InvalidateLogger.php:42] #9 Magento\Framework\Cache\InvalidateLogger->execute() called at [/var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Logger.php:58] #10 Magento\Framework\Cache\Frontend\Decorator\Logger->log() called at [/var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Logger.php:48] #11 Magento\Framework\Cache\Frontend\Decorator\Logger->clean() called at [/var/www/html/vendor/magento/module-backend/Controller/Adminhtml/Cache/FlushSystem.php:27] #12 Magento\Backend\Controller\Adminhtml\Cache\FlushSystem->execute() called at [/var/www/html/vendor/magento/framework/App/Action/Action.php:107] #13 Magento\Framework\App\Action\Action->dispatch() called at [/var/www/html/vendor/magento/module-backend/App/AbstractAction.php:229] #14 Magento\Backend\App\AbstractAction->dispatch() called at [/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58] #15 Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->___callParent() called at [/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138] #16 Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->Magento\Framework\Interception{closure}() called at [/var/www/html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143] #17 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [/var/www/html/vendor/magento/framework/Interception/Interceptor.php:135] #18 Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->Magento\Framework\Interception{closure}() called at [/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153] #19 Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->___callPlugins() called at [/var/www/html/generated/code/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem/Interceptor.php:26] #20 Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->dispatch() called at [/var/www/html/vendor/magento/framework/App/FrontController.php:55] #21 Magento\Framework\App\FrontController->dispatch() called at [/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58] #22 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138] #23 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}() called at [/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153] #24 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [/var/www/html/generated/code/Magento/Framework/App/FrontController/Interceptor.php:26] #25 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [/var/www/html/vendor/magento/framework/App/Http.php:135] #26 Magento\Framework\App\Http->launch() called at [/var/www/html/vendor/magento/framework/App/Bootstrap.php:256] #27 Magento\Framework\App\Bootstrap->run() called at [/var/www/html/index.php:39]

Sentry Domain not filled! error

version 2.2.3
magento/product-community-edition 2.3.4
I followed all the install instructions and added the following to env.php

    'sentry' => [
        'dsn' => 'https://[email protected]/5273034',
        'environment' => 'production',
        'log_level' => \Monolog\Logger::WARNING,
        'mage_mode_development' => false,
    ]

I went to Stores > Configuration > JustBetter > Sentry and turned on and tried testing and got the error message Sentry Domain not filled!

What should I do to debug further?

Unable to setup:di:compile with Magento non installed

Bug: What is the current behavior?
Running bin/magento setup:di:compile doesn't work if Magento 2 is not installed:

$ bin/magento setup:di:compile --verbose

In WebsiteRepository.php line 159:

  [DomainException]
  The default website isn't defined. Set the website and try again.


Exception trace:
 () at /var/www/vendor/magento/module-store/Model/WebsiteRepository.php:159
 Magento\Store\Model\WebsiteRepository->getDefault() at /var/www/vendor/magento/module-store/Model/StoreResolver/Website.php:49
 Magento\Store\Model\StoreResolver\Website->getAllowedStoreIds() at /var/www/vendor/magento/module-store/Model/StoresData.php:65
 Magento\Store\Model\StoresData->getStoresData() at /var/www/vendor/magento/module-store/Model/StoreResolver.php:138
 Magento\Store\Model\StoreResolver->getStoresData() at /var/www/vendor/magento/module-store/Model/StoreResolver.php:97
 Magento\Store\Model\StoreResolver->getCurrentStoreId() at /var/www/vendor/magento/module-store/Model/StoreManager.php:160
 Magento\Store\Model\StoreManager->getStore() at /var/www/generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php:119
 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() at /var/www/vendor/magento/module-store/Model/Resolver/Store.php:30
 Magento\Store\Model\Resolver\Store->getScope() at /var/www/vendor/magento/framework/App/Config/ScopeCodeResolver.php:49
 Magento\Framework\App\Config\ScopeCodeResolver->resolve() at /var/www/vendor/magento/framework/App/Config.php:69
 Magento\Framework\App\Config->getValue() at /var/www/vendor/justbetter/magento2-sentry/Helper/Data.php:74
 JustBetter\Sentry\Helper\Data->getConfigValue() at /var/www/vendor/justbetter/magento2-sentry/Helper/Data.php:85
 JustBetter\Sentry\Helper\Data->getGeneralConfig() at /var/www/vendor/justbetter/magento2-sentry/Helper/Data.php:94
 JustBetter\Sentry\Helper\Data->collectModuleConfig() at /var/www/vendor/justbetter/magento2-sentry/Helper/Data.php:59
 JustBetter\Sentry\Helper\Data->__construct() at /var/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /var/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/generated/code/JustBetter/Sentry/Helper/Data/Proxy.php:84
 JustBetter\Sentry\Helper\Data\Proxy->_getSubject() at /var/www/generated/code/JustBetter/Sentry/Helper/Data/Proxy.php:119
 JustBetter\Sentry\Helper\Data\Proxy->isActive() at /var/www/vendor/justbetter/magento2-sentry/Plugin/MonologPlugin.php:44
 JustBetter\Sentry\Plugin\MonologPlugin->addRecord() at /var/www/vendor/monolog/monolog/src/Monolog/Logger.php:623
 Monolog\Logger->debug() at /var/www/vendor/magento/framework/Cache/InvalidateLogger.php:46
 Magento\Framework\Cache\InvalidateLogger->execute() at /var/www/vendor/magento/framework/Cache/Frontend/Decorator/Logger.php:58
 Magento\Framework\Cache\Frontend\Decorator\Logger->log() at /var/www/vendor/magento/framework/Cache/Frontend/Decorator/Logger.php:48
 Magento\Framework\Cache\Frontend\Decorator\Logger->clean() at /var/www/vendor/magento/framework/App/Cache.php:102
 Magento\Framework\App\Cache->clean() at /var/www/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:153
 Magento\Setup\Console\Command\DiCompileCommand->execute() at /var/www/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/vendor/symfony/console/Application.php:893
 Symfony\Component\Console\Application->doRunCommand() at /var/www/vendor/symfony/console/Application.php:262
 Symfony\Component\Console\Application->doRun() at /var/www/vendor/magento/framework/Console/Cli.php:105
 Magento\Framework\Console\Cli->doRun() at /var/www/vendor/symfony/console/Application.php:145
 Symfony\Component\Console\Application->run() at /var/www/bin/magento:23

setup:di:compile

Bug: What is the expected behavior?
According to Magento Official Devdoc, it is possible to generate compiled code before installing Magento.
I tried to run it without justbetter/sentry, and the compilation works fine.
My use case is to generate code to allow our code analysis system to detect Factories, Proxies…

Bug: What is the proposed solution?
Pull request incoming…

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.
Tested on Magento 2.3.2 and justbetter/sentry version 0.7.2

Can't install version 3.0.0 in Magento 2.4.3-p1/p2

Hi,

I've tried to update the sentry package in my Magento 2.4.3-p1 (and also -p2). But I get an error regarding monolog:

$ bin/composer require justbetter/magento2-sentry
The "hirak/prestissimo" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option.
                                                                                                                                                                                                           Info from https://repo.packagist.org: #StandWithUkraine
Using version ^3.0 for justbetter/magento2-sentry
./composer.json has been updated
The "hirak/prestissimo" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option.
Running composer update justbetter/magento2-sentry --with-all-dependencies
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
In Laminas\DependencyPlugin\DependencyRewriterV2::onPrePoolCreate
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - magento/magento2-functional-testing-framework is locked to version 3.5.1 and an update of this package was not requested.
    - Conclusion: don't install monolog/monolog 1.18.2 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.19.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.0.2 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.1.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.20.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.21.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.1.1 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.22.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.22.1 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.2.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.3.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.23.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.24.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.3.1 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.25.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.25.1 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.3.2 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.3.3 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.25.2 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.25.3 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.3.4 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.25.4 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.25.5 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.3.5 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.4.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.26.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.26.1 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 2.5.0 (conflict analysis result)
    - Conclusion: don't install monolog/monolog 1.27.0 (conflict analysis result)
    - magento/product-community-edition 2.4.3-p2 requires magento/framework 103.0.3-p2 -> satisfiable by magento/framework[103.0.3-p2].
    - magento/product-community-edition is locked to version 2.4.3-p2 and an update of this package was not requested.
    - Root composer.json requires justbetter/magento2-sentry ^3.0 -> satisfiable by justbetter/magento2-sentry[3.0.0].
    - magento/framework 103.0.3-p2 requires monolog/monolog ^1.17 -> satisfiable by monolog/monolog[1.17.0, ..., 1.27.0].
    - You can only install one version of a package, so only one of these can be installed: monolog/monolog[1.0.0, ..., 1.27.0, 2.0.0, ..., 2.5.0].
    - justbetter/magento2-sentry 3.0.0 requires monolog/monolog >=2.0.0 -> satisfiable by monolog/monolog[2.0.0, ..., 2.5.0].
    - Conclusion: don't install monolog/monolog 2.0.1 (conflict analysis result)


Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Lazyloading SDK

Feature: What is your use case for such a feature?
Since Sentry can also be used in a production environment, improving load performance is desirable.

Feature: What is your proposed configuration entry? The new option to add? What is the behavior?
Sentry has the option to lazy load its SDK as per https://docs.sentry.io/platforms/javascript/install/lazy-load-sentry/
It will require minor modifications to the template to make it compatible.
It also has the additional benefit of automatically using the latest SDK version.

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.
Magento 2.4.3
Sentry 2.6.0

Setup by CLI

Hi

After updating to the latest version of this module, it seems it is no longer possible to setup using CLI.

php ~/public_html/bin/magento module:enable JustBetter_Sentry
php ~/public_html/bin/magento config:set sentry/general/enabled 1
php ~/public_html/bin/magento config:set sentry/general/dsn https://[email protected]/1234567
php ~/public_html/bin/magento config:set sentry/general/environment under-development

This was working in previous a previous version but now I get an error saying that the path doesnt exist.

Have the configuration path been changed? I understand that the settings have been moved, but even with --lock-env it still doesnt work

I am sure it is just me who missed something obvious, but not sure what it is :)

Not in production and development mode is false.

'sentry' => [
'dsn' => 'https://627aac5b01a344898ec4a85b9.......',
'logrocket_key' => 'magento-2-test/magento',
'environment' => 'developer',
'log_level' => \Monolog\Logger::WARNING,
'mage_mode_development' => false
]

I got this error when testing sentry

LogRocket sessionUrl not set

Do you want to request a feature or report a bug?
Bug

Bug: What is the current behavior?
The LogRocket sessionUrl does not show in Sentry's issue report when LogRocket is configured.

Screenshot 2021-01-17 at 12 58 06

Bug: What is the expected behavior?
The LogRocket sessionUrl should show in Sentry's issue report when LogRocket is configured.

Bug: What is the proposed solution?
I'm not sure to be honest, here's a few things I tried but didn't help:

  • Using setContext instead since setExtra was deprecated.
  • Adding it as a tag with setTag("sessionUrl", sessionUrl).
  • Using the latest 5.30.0 version of the JS SDK instead of 5.28.0.

I can confirm LogRocket works as expected and the URL does get generated (I added a console.log(sessionUrl) and visiting the logged URL does show the session replay fine). I'm not sure if this is an issue with the module or LogRocket/Sentry.

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.

Magento 2.4.1
Module 2.5.0

I can't login admin panel

Do you want to request a feature or report a bug?
bug

Bug: What is the current behavior?
When I enable this module,the admin panel will sign out soon after sign in.But the website front is normal.
Bug: What is the expected behavior?
sign in normal.
Bug: What is the proposed solution?

What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.
Magento version:2.4.2
sentry version:2.6

System Config throws JS Errors

Hi,

I am using the latest version of this module on Magento 2.3.4 Commerce. I am not able to send sentry test events via the button that is provided in the System Configuration.

The following error occurs:

image

You'll be able to reproduce this issue by navigating to the System Config of this module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.