pixielity / laravel-sentry
Sentry error tracking and monitoring with automatic context discovery for Pixielity applications
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 0
pkg:composer/pixielity/laravel-sentry
Requires
- php: ^8.5
- pixielity/laravel-support: *
- sentry/sentry-laravel: ^4.0
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.0
Suggests
- pixielity/laravel-telemetry-pulse: For real-time application monitoring
- pixielity/laravel-telemetry-telescope: For application debugging
README
Sentry error tracking and monitoring with automatic context discovery for Pixielity applications.
📑 Table of Contents
🌟 Overview
The Telemetry Sentry package simplifies error tracking by providing automatic discovery of Sentry context. You can define how Sentry reports should be enriched with user data, tags, and extra context using PHP 8 attributes.
📦 Installation
This package is included with the main pixielity/laravel-telemetry package. To install separately:
composer require pixielity/laravel-telemetry-sentry
✨ Features
- Automatic Context Discovery: Enrich Sentry reports automatically via
#[AsSentryContext]. - Scope Customization: Full control over Sentry Scope within attribute-decorated classes.
- Environment Aware: Configurable enabled state for different environments.
🎯 Attributes
AsSentryContext
Marks a class as a Sentry context provider. The class must be invokable and receive a Sentry\State\Scope instance.
Properties:
enabled: (default:true) Whether the context provider is active.priority: (default:100) Application priority.
💡 Examples
Check the .examples directory for real-world usage patterns.
Custom Context Provider
use Pixielity\Sentry\Attributes\AsSentryContext;
use Sentry\State\Scope;
#[AsSentryContext]
class AppContext
{
public function __invoke(Scope $scope): void
{
$scope->setTag('app_version', config('app.version'));
}
}