turbine-kreuzberg/spryker-sentry 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

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

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-25