Looking to hire Laravel developers? Try LaraJobs

laravel-sentry maintained by pixielity

Description
Sentry error tracking and monitoring with automatic context discovery for Pixielity applications
Last update
2026/02/09 15:03 (dev-main)
License
Downloads
0

Comments
comments powered by Disqus

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