vanta / temporal-sentry
集成 Temporal 与 Sentry
0.1.1
2024-02-21 05:41 UTC
Requires
- php: >=8.1
- sentry/sentry: ^3|^4
- temporal/sdk: ^2.7
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.46
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.5
- symfony/var-dumper: ^6.0
README
Temporal 是一种简单、可扩展的开源方式,用于编写和运行可靠的云应用。
简介
Sentry SDK for temporalio/sdk-php
安装
composer require vanta/temporal-sentry
使用
<?php declare(strict_types=1); use Sentry\SentrySdk; use Temporal\Interceptor\SimplePipelineProvider; use Temporal\WorkerFactory; use Vanta\Integration\Temporal\Sentry\SentryActivityInboundInterceptor; use Vanta\Integration\Temporal\Sentry\SentryWorkflowOutboundCallsInterceptor; use function Sentry\init; require_once __DIR__ . '/vendor/autoload.php'; init(['dsn' => 'https://1a36864711324ed8a04ba0fa2c89ac5a@sentry.temporal.local/52']); $hub = SentrySdk::getCurrentHub(); $client = $hub->getClient() ?? throw new \RuntimeException('Not Found client'); $factory = WorkerFactory::create(); $worker = $factory->newWorker( interceptorProvider: new SimplePipelineProvider([ new SentryActivityInboundInterceptor($hub, $client->getStacktraceBuilder()), new SentryWorkflowOutboundCallsInterceptor($hub, $client->getStacktraceBuilder()), ]) );