turbine-kreuzberg/spryker-sentry
最新稳定版本:0.1.2
Composer 安装命令:
composer require turbine-kreuzberg/spryker-sentry
包简介
Enable Sentry.io in your Spryker Shop easily with this Package/SDK
README 文档
README
About the package
This package enables Sentry.io to work with your Spryker shop by extending the Monitoring Module of Spryker and adding other hooks to here and there to enhance the data in Sentry.
Features
- Integration of Sentry.io with the Spryker Monitoring Module
- Possibility to ignore certain Exceptions with a configuration key
Installation
Composer
To get the latest version, simply require the package using Composer:
composer require turbine-kreuzberg/spryker-sentry
Configuration
Add the TurbineKreuzberg namespace to the PROJECT_NAMESPACES in your config/Shared/config_default.php file and configure the Sentry DSN:
$config[KernelConstants::PROJECT_NAMESPACES] = [ 'TurbineKreuzberg', // ... ]; $config[\TurbineKreuzberg\Shared\Sentry\SentryConstants::DSN] = '<your sentry DSN>';
Add the SentryMonitoringExtensionPlugin to Pyz\Service\Monitoring\MonitoringDependencyProvider:
<?php namespace Pyz\Service\Monitoring; use Spryker\Service\Monitoring\MonitoringDependencyProvider as SprykerMonitoringDependencyProvider; use TurbineKreuzberg\Service\Sentry\Plugin\Monitoring\SentryMonitoringExtensionPlugin; class MonitoringDependencyProvider extends SprykerMonitoringDependencyProvider { protected function getMonitoringExtensions(): array { return [ // ... new SentryMonitoringExtensionPlugin(), // ... ]; } }
Additional Configurations
You can adjust some configurations on the sentry module by adding some of this lines to your config file (ex. config_default.php):
// You can ignore certain exceptions by adding them to this array $config[SentryConstants::IGNORED_EXCEPTIONS] = [ ErrorException::class, // Example ]; // You can set your application version so that it gets reported to sentry $config[SentryConstants::APPLICATION_VERSION] = '1.0.0'; // You can even get it from an env variable $config[SentryConstants::APPLICATION_VERSION] = getenv('MY_APP_VERSION'); // You can set the percentage of your requests that are going to be traced for // performance monitoring, value goes from 0 to 1, being 0.2 = 20% $config[SentryConstants::TRACE_SAMPLE_RATE] = 0.4; // You can define custom serializers for complex objects like transfer objects // This will greatly enrich Sentry issues, making it possible to inspect object internal states across the backtrace // Note that you can use instances of classes that implement the __invoke method instead of a closure $config[SentryConstants::CLASS_SERIALIZERS] = [ Spryker\Shared\Kernel\Transfer\AbstractTransfer => function(Spryker\Shared\Kernel\Transfer\AbstractTransfer $data) { return $data->toArray(); } ];
统计信息
- 总下载量: 46.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-11-25