vanta / temporal-sentry
Integration temporal with sentry
Installs: 5 482
Dependents: 1
Suggesters: 1
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 0
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 is the simple, scalable open source way to write and run reliable cloud applications.
Introduction
Sentry SDK for temporalio/sdk-php
Installation
composer require vanta/temporal-sentry
Usage
<?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()), ]) );