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.
Package info
github.com/jeremykenedy/laravel-observability
pkg:composer/jeremykenedy/laravel-observability
Requires
- php: ^8.2|^8.3
- illuminate/routing: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.0|^3.0
- pestphp/pest-plugin-laravel: ^2.0|^3.0
This package is auto-updated.
Last update: 2026-04-03 08:57:43 UTC
README
A comprehensive observability package for Laravel with auto-detection of 25+ monitoring services, health checks, uptime monitoring, and frontend/backend error tracking integration.
Table of Contents
- Features
- Framework Support
- Requirements
- Installation
- Configuration
- All Supported Providers
- Backend Providers
- APM and Performance
- Frontend Monitoring
- Testing and Quality
- Uptime Monitoring
- Usage
- Adding a Backend Provider
- Adding a Frontend Provider
- Changing Frameworks
- Artisan Commands
- Testing
- License
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:
- Walk through CSS and frontend framework selection with back navigation
- Guide you through provider selection (backend, APM, frontend, testing/uptime)
- Install required composer and npm packages
- 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
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.
- Package:
composer require sentry/sentry-laravel - Env:
SENTRY_ENABLED=trueSENTRY_LARAVEL_DSN=your-dsn - Get Started: sentry.io/signup | Docs: docs.sentry.io/platforms/php/guides/laravel | API: docs.sentry.io/api
Bugsnag
Automatic error detection with diagnostic data and stability scores.
- Package:
composer require bugsnag/bugsnag-laravel - Env:
BUGSNAG_ENABLED=trueBUGSNAG_API_KEY=your-key - Get Started: app.bugsnag.com/user/new | Docs: docs.bugsnag.com/platforms/php/laravel | API: bugsnagapiv2.docs.apiary.io
Flare (Ignition)
Laravel-native error tracker by Spatie with rich context and solution suggestions.
- Package:
composer require spatie/laravel-ignition - Env:
FLARE_ENABLED=trueFLARE_KEY=your-key - Get Started: flareapp.io | Docs: flareapp.io/docs/general/projects
Rollbar
Error monitoring with telemetry, deploy tracking, and people tracking.
- Package:
composer require rollbar/rollbar-laravel - Env:
ROLLBAR_ENABLED=trueROLLBAR_TOKEN=your-token - Get Started: rollbar.com/signup | Docs: docs.rollbar.com/docs/laravel | API: docs.rollbar.com/reference
Honeybadger
Exception monitoring with check-ins, uptime, and cron monitoring.
- Package:
composer require honeybadger-io/honeybadger-laravel - Env:
HONEYBADGER_ENABLED=trueHONEYBADGER_API_KEY=your-key - Get Started: honeybadger.io | Docs: docs.honeybadger.io/lib/php/integration/laravel | API: docs.honeybadger.io/api
Airbrake
Error and performance monitoring with smart grouping.
- Package:
composer require airbrake/phpbrake - Env:
AIRBRAKE_ENABLED=trueAIRBRAKE_PROJECT_ID=idAIRBRAKE_PROJECT_KEY=key - Get Started: airbrake.io | Docs: docs.airbrake.io/docs/platforms/framework/php/laravel | API: airbrake.io/docs/devops-tools/api
Raygun
Crash reporting and real user monitoring for web and mobile.
- Package:
composer require mindscape/raygun4php - Env:
RAYGUN_ENABLED=trueRAYGUN_API_KEY=your-key - Get Started: raygun.com | Docs: raygun.com/documentation/language-guides/php/crash-reporting/laravel | API: raygun.com/documentation/product-guides/crash-reporting/api
APM and Performance
New Relic
Full-stack APM with transaction tracing, database monitoring, and infrastructure.
- Setup: Install the New Relic PHP agent (server-level, no composer)
- Env:
NEW_RELIC_ENABLED=trueNEW_RELIC_LICENSE_KEY=your-keyNEW_RELIC_APP_NAME=your-app - Get Started: newrelic.com/signup | Docs: docs.newrelic.com/docs/apm/agents/php-agent | API: docs.newrelic.com/docs/apis/rest-api-v2
Datadog
Infrastructure monitoring, APM, and log management.
- Setup: Install the Datadog PHP tracer (dd-trace extension)
- Env:
DATADOG_ENABLED=trueDATADOG_API_KEY=your-key - Get Started: datadoghq.com | Docs: docs.datadoghq.com/tracing/trace_collection/dd_libraries/php | API: docs.datadoghq.com/api/latest
AppSignal
Performance monitoring and error tracking for Ruby, Elixir, Node.js, and PHP.
- Package:
composer require appsignal/appsignal-laravel - Env:
APPSIGNAL_ENABLED=trueAPPSIGNAL_PUSH_API_KEY=your-key - Get Started: appsignal.com | Docs: docs.appsignal.com/php | API: docs.appsignal.com/api
Loggly
Cloud log management and analytics.
- Setup: Configure as a custom Monolog handler in
config/logging.php - Env:
LOGGLY_ENABLED=trueLOGGLY_TOKEN=your-token - Get Started: loggly.com | Docs: documentation.solarwinds.com/en/success_center/loggly/content/admin/php-logging.htm | API: documentation.solarwinds.com/en/success_center/loggly/content/admin/api-overview.htm
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.
- npm:
npm install logrocket - Env:
LOGROCKET_ENABLED=trueLOGROCKET_APP_ID=your-app-id - Get Started: logrocket.com | Docs: docs.logrocket.com/docs/quickstart | API: docs.logrocket.com/reference
Instabug
In-app bug reporting, crash reporting, and user feedback.
- Setup: CDN script or SDK
- Env:
INSTABUG_ENABLED=trueINSTABUG_TOKEN=your-token - Get Started: instabug.com | Docs: docs.instabug.com/docs/web-integration | API: docs.instabug.com/reference
Gleap
Visual bug reporting, feature requests, and live chat.
- npm:
npm install gleap - Env:
GLEAP_ENABLED=trueGLEAP_API_KEY=your-key - Get Started: gleap.io | Docs: docs.gleap.io/docs/javascript-sdk | API: docs.gleap.io/reference
Firebase Crashlytics
Crash reporting for mobile apps (iOS/Android). For web, use Firebase Performance Monitoring.
- Setup: Firebase SDK
- Get Started: firebase.google.com | Docs: firebase.google.com/docs/crashlytics | API: firebase.google.com/docs/reference/rest
Memfault
Observability for embedded/IoT devices. Integrate via API for device telemetry.
- Env:
MEMFAULT_ENABLED=trueMEMFAULT_PROJECT_KEY=your-key - Get Started: memfault.com | Docs: docs.memfault.com | API: docs.memfault.com/docs/cloud/rest-api
Testing and Quality
Ghost Inspector
Automated browser testing with visual regression and API-triggered test suites.
- Env:
GHOST_INSPECTOR_ENABLED=trueGHOST_INSPECTOR_API_KEY=your-key - Get Started: ghostinspector.com | Docs: ghostinspector.com/docs | API: ghostinspector.com/docs/api
Google Lighthouse
Performance, accessibility, SEO, and best practices auditing.
- Setup: Run via CI:
npx lighthouse <url> --output json --chrome-flags="--headless" - Get Started: developer.chrome.com/docs/lighthouse/overview | Docs: github.com/GoogleChrome/lighthouse | API (PageSpeed Insights): developers.google.com/speed/docs/insights/v5/get-started
Link Checker
Automated broken link detection using Spatie's Laravel package.
- Package:
composer require spatie/laravel-link-checker - Get Started: github.com/spatie/laravel-link-checker | Docs: github.com/spatie/laravel-link-checker#usage
SSL Checker
Monitor SSL certificate validity and configuration.
- Get Started: ssllabs.com/ssltest | API: github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md
Visual Regression Tests (Buddy.Works)
Visual regression testing integrated into CI/CD pipelines.
- Get Started: buddy.works | Docs: buddy.works/docs | API: buddy.works/docs/api/getting-started
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.
- Env:
UPTIMEROBOT_ENABLED=trueUPTIMEROBOT_API_KEY=your-key - Get Started: uptimerobot.com | Docs: uptimerobot.com/api | API: uptimerobot.com/api/getMonitors
StatusCake
Website monitoring with uptime, page speed, and domain checks.
- Env:
STATUSCAKE_ENABLED=trueSTATUSCAKE_API_KEY=your-key - Get Started: statuscake.com | Docs: statuscake.com/kb | API: statuscake.com/api/v1
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
- composer require vendor/package
- Set PROVIDER_ENABLED=true in .env
- Auto-detected on next request
Adding a Frontend Provider
- Set PROVIDER_ENABLED=true in .env
- Add @observabilityScripts to layout head
- 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.