Giter Site home page Giter Site logo

aliinca / telescope-guzzle-watcher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huzaifaarain/telescope-guzzle-watcher

0.0 0.0 0.0 463 KB

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

Home Page: https://packagist.org/packages/muhammadhuzaifa/telescope-guzzle-watcher

License: MIT License

PHP 100.00%

telescope-guzzle-watcher's Introduction

We Stand With Palestine, Pakistan Stand With Palestine

StandWithPalestine

Telescope Guzzle Watcher

Latest Version on Packagist GitHub Tests Action Status Total Downloads


Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

Once the installation and configurations are completed, you will be able to see the request logs under telescope/client-requests

Installation

You can install the package via composer:

composer require muhammadhuzaifa/telescope-guzzle-watcher

Usage

You can publish the config file with:

php artisan vendor:publish --tag="telescope-guzzle-watcher-config"

This is the contents of the published config file:

return [

    /*
    |--------------------------------------------------------------------------
    | Except Request Headers
    |--------------------------------------------------------------------------
    |
    | This value is used when you need to exclude the request headers from
    | being recorded under the telescope. You can exclude any number of
    | headers containing sensitive information
    |
    */

    'except_request_headers' => [],

    /*
    |--------------------------------------------------------------------------
    | Except Response Headers
    |--------------------------------------------------------------------------
    |
    | This value is used when you need to exclude the response headers from
    | being recorded under the telescope. You can exclude any number of
    | headers containing sensitive information
    |
    */

    'except_response_headers' => [],

    /*
    |--------------------------------------------------------------------------
    | Enable URI Tags
    |--------------------------------------------------------------------------
    |
    | This value is used for determining wether the watcher should parse the url
    | and add it's segments as telescope tags
    |
    |
    */

    'enable_uri_tags' => true,

    /*
    |--------------------------------------------------------------------------
    | Exclude words from URI tags
    |--------------------------------------------------------------------------
    |
    | This value is used when you need to exclude words or patterns that should
    | be excluded from the tags list
    |
    */

    'exclude_words_from_uri_tags' => [],

    /*
    |--------------------------------------------------------------------------
    | Content Size Limit
    |--------------------------------------------------------------------------
    |
    | This value is used when you need to limit the response content.
    | Default is 64.
    |
    */

    'size_limit' => null,
];

You can set the headers that needs to be excluded such as API Keys or other sensitive information. You can also tag uri segments by converting them into an array. This feature can be toggled true/false.

Edit config/telescope.php file and add the watcher

return [
    // other telescope configurations
     \MuhammadHuzaifa\TelescopeGuzzleWatcher\Watchers\TelescopeGuzzleWatcher::class,
];

The watcher depends on the Service Container and every instance of guzzle client must be resolve using Service Container.

$client = app(\GuzzleHttp\Client::class); // will work
$client = new \GuzzleHttp\Client(); // will not work

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

Other Projects

  • Laravel Pulse Guzzle Recorder
    • Laravel Pulse Guzzle Recorder provide a custom recorder for intercepting http requests made via guzzlehttp/guzzle php library and log them into the Laravel Pulse Slow Outgoing Requests section.

License

The MIT License (MIT). Please see License File for more information.

telescope-guzzle-watcher's People

Contributors

freekmurze avatar huzaifaarain avatar mvdnbrk avatar pforret avatar sebastiandedeyne avatar nielsvanpach avatar dependabot[bot] avatar github-actions[bot] avatar adrianmrn avatar alexvanderbist avatar riasvdv avatar patinthehat avatar irfanm96 avatar crynobone avatar igedeon avatar jessarcher avatar sixlive avatar willemvb avatar abenerd avatar koossaayy avatar aliinca avatar yaroslawww avatar medilies avatar narcisonunez avatar ziarv avatar bvtterfly avatar thecaliskan avatar olumby avatar maartenpaauw avatar lloricode avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.