jeremykenedy/laravel-observability
Composer 安装命令:
composer require 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.
README 文档
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.
jeremykenedy/laravel-observability 适用场景与选型建议
jeremykenedy/laravel-observability 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 4, 最近一次更新时间为 2026 年 03 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「health」 「laravel」 「bugsnag」 「sentry」 「DataDog」 「flare」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jeremykenedy/laravel-observability 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jeremykenedy/laravel-observability 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jeremykenedy/laravel-observability 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bugsnag log engine for CakePHP.
Log errors/exceptions to Bugsnag.
Is your Laravel app OK? Health checks running in production to ensure you can sleep well at night and be sure everything is still OK.
Provides healthcheck endpoints in accordance with IETF's healthcheck draft RFC
Provide status and health api endpoints
Yii1 bugsnag error handler
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 32
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-28