Code execution monitoring for Laravel applications.

Overview

Inspector | Code Execution Monitoring Tool

Total Downloads Latest Stable Version License

Simple code execution monitoring, built for Laravel developers.

Requirements

  • PHP >= 7.2.0
  • Laravel >= 5.5

Install

Install the latest version by:

composer require inspector-apm/inspector-laravel

For Lumen

If your application is based on Lumen you need to manually register the InspectorServiceProvider:

$app->register(\Inspector\Laravel\InspectorServiceProvider::class);

Configure the Ingestion Key

First put the Ingestion Key in your environment file:

INSPECTOR_INGESTION_KEY=[ingestion key]

You can obtain an INSPECTOR_INGESTION_KEY creating a new project in your Inspector account.

Attach the Middleware

To monitor web requests you can attach the WebMonitoringMiddleware in your http kernel or use in one or more route groups based on your personal needs.

/**
 * The application's route middleware groups.
 *
 * @var array
 */
protected $middlewareGroups = [
    'web' => [
        ...,
        \Inspector\Laravel\Middleware\WebRequestMonitoring::class,
    ],

    'api' => [
        ...,
        \Inspector\Laravel\Middleware\WebRequestMonitoring::class,
    ]

Test everything is working

Run the command below:

php artisan inspector:test

Go to https://app.inspector.dev/home to explore your data.

Official documentation

See official documentation

LICENSE

This package is licensed under the MIT license.

Comments
  • Undefined property: Inspector\Laravel\Inspector::$transaction

    Undefined property: Inspector\Laravel\Inspector::$transaction

    Describe the bug Inspector randomly throws this error

    To Reproduce Cant' find a way to reproduce. Seems this error occurs when running scheduled jobs.

    Expected behavior Not thrown any error

    Screenshots

    Web (please complete the following information):

    • Package Version 4.7.2
    • Laravel / Lumen version 7.30.4

    Additional context

    Undefined property: Inspector\Laravel\Inspector::$transaction File ../vendor/inspector-apm/inspector-php/src/Inspector.php Line 109
    #0  ..vendor/inspector-apm/inspector-php/src/Inspector.php(109): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
    #1  ..vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Inspector\Inspector->currentTransaction()
    #2  ..vendor/inspector-apm/inspector-laravel/src/Providers/JobServiceProvider.php(121): Illuminate\Support\Facades\Facade::__callStatic()
    #3  ..vendor/inspector-apm/inspector-laravel/src/Providers/JobServiceProvider.php(65): Inspector\Laravel\Providers\JobServiceProvider->handleJobEnd()
    #4  ..vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(381): Inspector\Laravel\Providers\JobServiceProvider->Inspector\Laravel\Providers\{closure}()
    #5  ..vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(226): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()
    #6  ..vendor/laravel/framework/src/Illuminate/Queue/Worker.php(540): Illuminate\Events\Dispatcher->dispatch()
    #7  ..vendor/laravel/framework/src/Illuminate/Queue/Worker.php(392): Illuminate\Queue\Worker->raiseExceptionOccurredJobEvent()
    #8  ..vendor/laravel/framework/src/Illuminate/Queue/Worker.php(360): Illuminate\Queue\Worker->handleJobException()
    #9  ..vendor/laravel/framework/src/Illuminate/Queue/Worker.php(306): Illuminate\Queue\Worker->process()
    #10 ../vendor/laravel/framework/src/Illuminate/Queue/Worker.php(132): Illuminate\Queue\Worker->runJob()
    #11 ../vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(112): Illuminate\Queue\Worker->daemon()
    #12 ../vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(96): Illuminate\Queue\Console\WorkCommand->runWorker()
    #13 ../vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
    #14 ../vendor/laravel/framework/src/Illuminate/Container/Util.php(37): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
    #15 ../vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
    #16 ../vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
    #17 ../vendor/laravel/framework/src/Illuminate/Container/Container.php(596): Illuminate\Container\BoundMethod::call()
    #18 ../vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call()
    #19 ../vendor/symfony/console/Command/Command.php(288): Illuminate\Console\Command->execute()
    #20 ../vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()
    #21 ../vendor/symfony/console/Application.php(974): Illuminate\Console\Command->run()
    #22 ../vendor/symfony/console/Application.php(291): Symfony\Component\Console\Application->doRunCommand()
    #23 ../vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun()
    #24 ../vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()
    #25 ../vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
    #26 ../artisan(37): Illuminate\Foundation\Console\Kernel->handle()
    #27 {main}
    
    bug 
    opened by felippeduarte 21
  • After run test, not show execption

    After run test, not show execption

    I'm using Laravel 5.8 and "inspector-apm/inspector-laravel": "^4.4" after following install instruction https://docs.inspector.dev/laravel/installation

    I'm running command php artisan inspector:test here the result

    image

    but in inspector dashboard, it doesn't show anything.

    Is there something wrong?

    maybe it's a DNS problem, but what domain should I check? Here I tried ping some domains

    image

    opened by ganjarsetia 16
  • Command line is too long in windows

    Command line is too long in windows

    Inspector is working like a charm on linux, but on windows where the max command line is @8200 chars the inspector:test (and any error) won't be submitted via api since the CMD states "Command line is too long" image

    Since echo %path% shows that only the path is about 2k chars (and it is needed to be set with all of those paths so shortening it is not a solution) it would be lovely if there was a way to set up curl in some custom way this package could use it or get it that avoided this horrible problem windows will never fix since they don't care and want to force users to do short paths.

    I don't know if its useful but I found a stackoverflow that might help solving this problem https://stackoverflow.com/questions/682799/what-to-do-with-the-input-line-is-too-long-error-message?noredirect=1&lq=1 by using double quotation when calling a command.

    enhancement question 
    opened by darkrevenger 12
  • Error: Undefined property: Inspector\Laravel\Inspector::$transaction

    Error: Undefined property: Inspector\Laravel\Inspector::$transaction

    We're having an issue that's being reported and potentially breaking some of our queued jobs, looks like something is trying to access the $transaction property.

    Screen Shot 2022-05-06 at 08 16 55

    opened by Sammyjo20 10
  • ArgumentCountError on AddSegment method

    ArgumentCountError on AddSegment method

    Describe the bug After creating an account and an application and following the installation documentation, I try to run the test command, which returns the error below.

    To Reproduce Steps to reproduce the behavior:

    1. After installation
    2. Run php artisan inspector:test

    Screenshots Screenshot 2022-05-20 at 16 20 51

    Web (please complete the following information):

    • Package Version: 4.7.22
    • Laravel framework version: 8.9
    • PHP version: 8.0.19
    • Queue: sync (locally)
    opened by cephee 8
  • add default value

    add default value

    referencing #11

    I'm 99% sure that this will prevent any issues during deployment/installation and only mirrors the default config file rather than passing null

    opened by spoyntersmith 5
  • Question: What happens if Inspector goes down?

    Question: What happens if Inspector goes down?

    Does Inspector temporarily disable itself if it detects a flurry of "5xx" errors from your server? I've noticed when disabling inspector, the response times are a lot faster. Is there an option to run reporting on queue?

    opened by Sammyjo20 5
  • Issue in GateServiceProvider.php right after install

    Issue in GateServiceProvider.php right after install

    Hi everyone,

    I just installed the inspector-laravel package into my Laravel API (v5.8.38). I followed the documentation but right after all steps done I'm having the follower error:

    Argument 1 passed to Inspector\Laravel\Providers\GateServiceProvider::beforeGateCheck() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of Api\Models\Entities\Eloquent\User given, called in /**/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 473.

    In file /**/vendor/inspector-apm/inspector-laravel/src/Providers/GateServiceProvider.php.

    For now I didn't load any middleware but as I understand from the documentation, this is not mandatory.

    Am I doing something wrong?

    Many thanks, Gabriel

    bug 
    opened by Gab-Metzger 4
  • Error on Configuration.php line 72 : Invalid URL

    Error on Configuration.php line 72 : Invalid URL

    Hi, im trying to install on Laravel Framework 6.13.1 ( local dev server ) but error happen.

    $ composer require inspector-apm/inspector-laravel
    Using version ^4.1 for inspector-apm/inspector-laravel
    ./composer.json has been updated
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Nothing to install or update
    Generating optimized autoload files
    > Illuminate\Foundation\ComposerScripts::postAutoloadDump
    > @php artisan package:discover --ansi
    
    In Configuration.php line 72:
    
      Invalid URL
    

    when i run artisan command, this error shows

    $ php artisan inspector:test
    
    In Configuration.php line 72:
                   
      Invalid URL  
    
    opened by randhipp 4
  • v4.7.20 deprecated in PHP 8.1.3

    v4.7.20 deprecated in PHP 8.1.3

    Describe the bug On PHP 8.1.3, when using inspector-laravel 4.7.20 we're getting PHP Deprecated in log: [08-Mar-2022 09:20:26 Europe/Warsaw] PHP Deprecated: Return type of Inspector\Models\Arrayable::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /[...]/vendor/inspector-apm/inspector-php/src/Models/Arrayable.php on line 112

    To Reproduce Steps to reproduce the behavior: Install inspector-laravel on Laravel 9 with PHP 8.1.3, look for error log

    opened by alanwojcik 3
  • v4.7.19 throwing errors

    v4.7.19 throwing errors

    Hi there,

    Thanks for building Inspector, it's great! I went to upgrade Inspector today and we're now getting this error, we're running Laravel 8. It looks like something that was introduced in 4.7.19.

    These are happening in our tests even though the Inspector key was not specified.

    Screen Shot 2022-02-18 at 08 38 20

    opened by Sammyjo20 3
  • Using during tests with PestPhp

    Using during tests with PestPhp

    Describe the bug If run test using pest we can face issue with config container instance that its not resolved yet.

    To Reproduce Steps to reproduce the behavior:

    1. Run any test with Pest

    Expected behavior No erors

    Additional context Was able to fix it with wrapping into app()->env('testing') condition. I think it makes sense to skip this env for such tool. I can open PR which fixes it

    opened by oleghalin 0
  • Slow (and at times Error 504 Timeout) when used with Laravel-Jetstream-Inertia stack in web middleware group

    Slow (and at times Error 504 Timeout) when used with Laravel-Jetstream-Inertia stack in web middleware group

    Describe the bug When used in a Laravel Jetstream with the inertia stack, the page becomes slow and at times results to a timeout error once the middleware is registered under the 'web' group.

    To Reproduce Steps to reproduce the behavior:

    1. Install anfresh installation of laravel inertia (Jetstream)
    2. Install this package and configure kernel.php as instructed
    3. Refresh page. Slow page response and at times Error 504 Gateway Time-Out occurs
    4. Remove the impoort on the web middleware (thereby leaving it only on the api group)
    5. No timeout. Works as expected

    Expected behavior No error 504 when used with Laravel Inertia

    Web (please complete the following information):

    • Browser chrome, safari
    • Package Version ^4.7
    • Laravel 9.x

    Additional context Add any other context about the problem here.

    opened by lexxyungcarter 0
Releases(4.7.28)
Owner
Inspector
Simple code execution monitoring, built for developers
Inspector
Multiple channels of laravel exception notification(DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 laravel 异常通知(钉钉群机器人、飞书群机器人、Server 酱、企业微信群机器人、息知)。

laravel-exception-notify 简体中文 | ENGLISH Multiple channels of laravel exception notification(DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 laravel

guanguans 61 Dec 8, 2022
Laravel SMS allows you to send SMS from your Laravel application using multiple sms providers, allow to add custom sms provider

Laravel SMS Laravel SMS allows you to send SMS from your Laravel application using multiple sms providers, allow to add custom sms provider Requiremen

Ayman Alaiwah 3 May 7, 2022
@Authy notification channel for @Laravel, with the ability to send in-app, sms, and call verification tokens.

Authy Notification Channel for Laravel Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens. Tab

Laravel Notification Channels 57 Dec 19, 2022
Google Chat - Laravel Notification Channel

Google Chat - Laravel Notification Channel This package makes it easy to send notifications using Google Chat , (formerly known as Hangouts Chat) with

Laravel Notification Channels 36 Dec 6, 2022
Laravel Security Notifications

This package adds security notifications to warn your users when significant security events occur so that they aren't the next victim of an attacker.

Anteris 5 Feb 8, 2022
Laravel package to launch toast notifications.

Laravel package to launch toast notifications. This package provides assistance when using toast notifications. Using the iziTOAST package, which allo

Anthony Medina 7 Nov 25, 2022
Laravel SMS Notification Channel

Laravel SMS Notification Channel Installation composer require guangda/laravel-sms-notification-channel env 配置 SMS_PROVIDER=yunpian SMS_SIGNATURE=【签名

Guangda 6 Dec 29, 2021
Laravel Subscribable Notifications

Laravel Subscribable Notifications This package allows you to subscribe your app Users to your app Notifications and dispatch them without specifying

Andrés Santibáñez 132 Nov 10, 2022
A Toast notification library for the Laravel TALL stack.

A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS ????

John F 365 Jan 7, 2023
Slack notification for Laravel as it should be. Easy, fast, simple and highly testable.

Based on illuminate/mail About Laravel Slack Slack notification for Laravel as it should be. Easy, fast, simple and highly testable. Since it uses On-

Guilherme Pressutto 284 Aug 24, 2022
Larafirebase is a package thats offers you to send push notifications or custom messages via Firebase in Laravel.

Introduction Larafirebase is a package thats offers you to send push notifications or custom messages via Firebase in Laravel. Firebase Cloud Messagin

Kutia Software Company 264 Jan 7, 2023
Lark Notification Channel for laravel.

Lark notifications channel for Laravel This package makes it easy to send Lark using the Laravel notification system. Supports 5.5+, 6.x, 7.x and 8.x.

null 1 Nov 3, 2021
AmaranJS stylish notification for your laravel application.

AmaranJS Laravel 5 Package AmaranJS L5 package is a Laravel wrapper for my jquery plugin AmaranJS.You can create easy and stylish notifications with A

Hakan ERSU 24 Oct 3, 2019
SMS service provider for Laravel

laravel-sms SMS service provider for Laravel and Lumen. Uses SMS Client to enable sending SMS messages using the following drivers: nexmo clockwork te

Matthew Daly 34 Nov 29, 2022
Our Laravel Sendgrid Notification package

laravel-sendgrid-notification-channel Laravel Sendgrid Notification channel Installation To get started, you need to require this package: composer re

Konstruktiv B.V. 4 Feb 3, 2022
Flexible Flash notifications for Laravel

Introduction Laravel Notify is a package that lets you add custom notifications to your project. A diverse range of notification design is available.

Arthur Monney 1.2k Dec 26, 2022
A package to simplify automating future notifications and reminders in Laravel

Laravel Snooze Schedule future notifications and reminders in Laravel Why use this package? Ever wanted to schedule a future notification to go out at

Thomas Kane 720 Jan 7, 2023
Lara-Izitoast : Laravel Notification Package

Lara-Izitoast : Laravel Notification Package This is a laravel notification wrapper build with http://izitoast.marcelodolce.com javascript library. Ho

Apps:Lab KE 34 Nov 19, 2022
laravel send sms. kavenegar, ghasedak

Requirements laravel >= 7 Installation composer require ehsanmoradi/laravel-sms Publish the configuration file (this will create a laravel-sms.php

ehsan moradi 3 Feb 6, 2022