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

v1.0.0 2026-02-09 03:23 UTC

This package is auto-updated.

Last update: 2026-02-09 10:03:48 UTC


README

Sentry

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'));
    }
}