jeremykenedy/laravel-observability

A Laravel package providing observability with auto-detection of Sentry, Bugsnag, Datadog, and Flare, plus APM metrics, health checks, and error context enrichment.

Maintainers

Package info

github.com/jeremykenedy/laravel-observability

pkg:composer/jeremykenedy/laravel-observability

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v1.0.1 2026-03-28 22:43 UTC

This package is auto-updated.

Last update: 2026-04-03 08:57:43 UTC


README

Laravel Observability

A comprehensive observability package for Laravel with auto-detection of 25+ monitoring services, health checks, uptime monitoring, and frontend/backend error tracking integration.

Total Downloads Latest Stable Version Tests StyleCI License: MIT

Table of Contents

Features

Feature
Auto-detection of 25+ monitoring providers
Health check endpoint with DB, cache, storage, queue checks
Backend providers auto-load when composer package installed
Frontend providers output JS via @observabilityScripts directive
UptimeRobot and StatusCake API integration
Per-provider enable/disable via .env
Provider type classification (backend, frontend, both, testing)
Interactive installer with ASCII art and stepped prompts
3 CSS frameworks x 5 frontend frameworks = 15 rendering modes
Publishable config via artisan

Framework Support

Blade Livewire Vue 3 React 18 Svelte 4
Tailwind v4
Bootstrap 5
Bootstrap 4

Requirements

  • PHP 8.2+
  • Laravel 12 or 13
  • A CSS framework: Tailwind CSS v4, Bootstrap 5, or Bootstrap 4
  • A frontend: Blade, Livewire 3, Vue 3, React 18, or Svelte 4

Installation

composer require jeremykenedy/laravel-observability
php artisan observability:install

The installer will:

  1. Walk through CSS and frontend framework selection with back navigation
  2. Guide you through provider selection (backend, APM, frontend, testing/uptime)
  3. Install required composer and npm packages
  4. Collect API credentials and save them to .env

If the package is already installed, the installer will suggest using observability:update instead. To force a fresh reinstall, type confirm when prompted or use --force.

Configuration

php artisan vendor:publish --tag=observability-config

All Supported Providers

Provider Type Website Documentation API Reference
Sentry Backend sentry.io Laravel Guide API Docs
Bugsnag Backend bugsnag.com Laravel Guide API Docs
Flare Backend flareapp.io Setup Guide --
Rollbar Both rollbar.com Laravel Guide API Docs
Honeybadger Both honeybadger.io Laravel Guide API Docs
Airbrake Backend airbrake.io Laravel Guide API Docs
Raygun Both raygun.com Laravel Guide API Docs
Laravel Exception Notifier Backend GitHub README --
New Relic Backend newrelic.com PHP Agent Docs API Docs
Datadog Both datadoghq.com PHP Tracing API Docs
AppSignal Backend appsignal.com PHP Docs API Docs
Loggly Backend loggly.com PHP Logging API Docs
LogRocket Frontend logrocket.com Quickstart API Docs
Instabug Frontend instabug.com Web Integration API Docs
Gleap Frontend gleap.io JavaScript SDK API Docs
Firebase Crashlytics Frontend firebase.google.com Crashlytics Docs REST API
Memfault Frontend memfault.com Docs REST API
Ghost Inspector Testing ghostinspector.com Docs API Docs
Google Lighthouse Testing Chrome DevTools GitHub PageSpeed API
Spatie Link Checker Testing GitHub Usage Guide --
SSL Labs Testing ssllabs.com About API Docs
Buddy.Works Testing buddy.works Docs API Docs
UptimeRobot Uptime uptimerobot.com API Docs API Docs
StatusCake Uptime statuscake.com Knowledge Base API v1

Backend Providers

Install the composer package, set PROVIDER_ENABLED=true in .env, add credentials. The provider auto-loads on the next request.

Sentry

Real-time error tracking with full stack traces, breadcrumbs, and release tracking.

Bugsnag

Automatic error detection with diagnostic data and stability scores.

Flare (Ignition)

Laravel-native error tracker by Spatie with rich context and solution suggestions.

Rollbar

Error monitoring with telemetry, deploy tracking, and people tracking.

Honeybadger

Exception monitoring with check-ins, uptime, and cron monitoring.

Airbrake

Error and performance monitoring with smart grouping.

Raygun

Crash reporting and real user monitoring for web and mobile.

APM and Performance

New Relic

Full-stack APM with transaction tracing, database monitoring, and infrastructure.

Datadog

Infrastructure monitoring, APM, and log management.

AppSignal

Performance monitoring and error tracking for Ruby, Elixir, Node.js, and PHP.

Loggly

Cloud log management and analytics.

Frontend Monitoring

These providers monitor your frontend (browser sessions, user interactions, crashes). Enable in .env and add @observabilityScripts to your layout <head>, or install npm packages manually.

<head>
    @observabilityScripts
</head>

LogRocket

Session replay with error tracking and performance monitoring.

Instabug

In-app bug reporting, crash reporting, and user feedback.

Gleap

Visual bug reporting, feature requests, and live chat.

Firebase Crashlytics

Crash reporting for mobile apps (iOS/Android). For web, use Firebase Performance Monitoring.

Memfault

Observability for embedded/IoT devices. Integrate via API for device telemetry.

Testing and Quality

Ghost Inspector

Automated browser testing with visual regression and API-triggered test suites.

Google Lighthouse

Performance, accessibility, SEO, and best practices auditing.

Link Checker

Automated broken link detection using Spatie's Laravel package.

SSL Checker

Monitor SSL certificate validity and configuration.

Visual Regression Tests (Buddy.Works)

Visual regression testing integrated into CI/CD pipelines.

Uptime Monitoring

External services that ping your application to monitor availability. Configure via their dashboards, then optionally pull status data via the package's API integration.

UptimeRobot

Free uptime monitoring with 5-minute checks and status pages.

StatusCake

Website monitoring with uptime, page speed, and domain checks.

Usage

Health Checks

GET /health           -> status, checks
GET /health/providers -> detected, active, backend, frontend, testing, uptime
GET /health/uptime    -> uptimerobot, statuscake data

Provider Detection

$detector = app(ProviderDetector::class);
$detector->detect();
$detector->getActiveProviders();
$detector->getProvidersByType('frontend');
$detector->getFrontendSnippets();

Frontend Scripts Blade Directive

<head>
    @observabilityScripts
</head>

Outputs script tags for all enabled frontend providers with credentials injected.

Uptime API

$uptime = app(UptimeService::class);
$uptime->getUptimeRobotStatus();
$uptime->getStatusCakeStatus();

Adding a Backend Provider

  1. composer require vendor/package
  2. Set PROVIDER_ENABLED=true in .env
  3. Auto-detected on next request

Adding a Frontend Provider

  1. Set PROVIDER_ENABLED=true in .env
  2. Add @observabilityScripts to layout head
  3. Or install npm package and init manually

Changing Frameworks

After installation, use update or switch to change frameworks without losing configuration.

Update (Interactive)

The update command walks through framework selection with an interactive menu:

php artisan observability:update

Or pass options directly:

php artisan observability:update --css=bootstrap5 --frontend=vue
Option Values Description
--css tailwind, bootstrap5, bootstrap4 Change CSS framework
--frontend blade, livewire, vue, react, svelte Change frontend framework

The update command also provides provider management: re-publish config, update credentials, enable/disable providers, and view detailed status.

Switch (Quick)

php artisan observability:switch --css=bootstrap5
php artisan observability:switch --frontend=livewire
php artisan observability:switch --css=tailwind --frontend=vue

After switching, run npm run build.

Artisan Commands

Command Description
observability:install Fresh install with interactive prompts. Detects existing installation.
observability:update Update framework selection and manage providers interactively. Does not overwrite config.
observability:switch Quick framework switch via flags.

Install Options

Flag Description
--css= CSS framework: tailwind, bootstrap5, bootstrap4
--frontend= Frontend: blade, livewire, vue, react, svelte
--force Skip reinstall confirmation when already installed

Update Options

Flag Description
--css= CSS framework: tailwind, bootstrap5, bootstrap4
--frontend= Frontend: blade, livewire, vue, react, svelte

Switch Options

Flag Description
--css= CSS framework: tailwind, bootstrap5, bootstrap4
--frontend= Frontend: blade, livewire, vue, react, svelte

Testing

./vendor/bin/pest

License

This package is open-sourced software licensed under the MIT license.