taivas-apm/taivas-apm-laravel

Application Performance Monitoring for Laravel

v0.3.2-alpha 2020-09-12 17:00 UTC

This package is auto-updated.

Last update: 2024-04-13 01:26:19 UTC


README

Build Status

Taivas is an Application Performance Monitoring (APM) software for Laravel. 📊

Most apps are not continuously tested for best practices. Taivas solves that problem by allowing you realtime insight into the production performance of your Laravel application. Taivas analyzes your requests and collects database queries, cache performance and much more. The free hosted Taivas Frontend allows you to see which requests take longer than they should, which requests to optimize and provides many graphs about your application's performance history.

⭐ Highlights

  • Super easy to install (takes ~5 minutes)
  • Free hosted frontend so you don't have to setup it yourself
  • Extremely high performance. The redis persister adds only about 0.5ms to each request.

🚀 Installation

Require this package in the composer.json of your Laravel project.

composer require taivas-apm/taivas-apm-laravel

Publish the configuration:

php artisan vendor:publish --provider="TaivasAPM\TaivasAPMServiceProvider"

Set the TAIVAS_SECRET key in your .env file. To do that, create a random string with tinker:

php artisan tinker
Str::random(32)

Execute the taivas migrations to create a table to store the request data

php artisan migrate

If your cors configuration is not open, allow access from our hosted web app in your cors config file (config/cors.php):

...
'paths' => ['your-api/*', 'taivas/*'],
...
'allowed_origins' => ['yourdomain.com', 'app.taivas.io'],

If you do not want to use the hosted frontend, you can host it yourself. However, you will have to make sure to keep it up to date.

🚀 Open the hosted web app

Enter your domain and login with the user credentials from your own application. All communication happens between your browser and your own application.

👍 Tips

  • For smaller sites (< 1 request/second) it's fine to use the sync driver.
  • For larger sites you should use the redis persister to move the load from your webserver to your cronjob server.
  • For larger sites you should set the lottery setting so only some of the requests are tracked.

⛵ Roadmap

  • Specifying a non-default redis connection
  • Combine the shouldTrack logic from the Service Provider and the Tracker class
  • Automatic tests for all supported Laravel Versions
  • Custom analytics support
  • ClickHouse support
  • Managed request storage service

Dependencies

  • Laravel >= 5.5
  • A Laravel supported database to store the requests
  • Redis, if you want to persist requests asynchronously

Thanks

Thanks to Taylor Otwell & team for giving so much to the open source community. The code structure of this package is based on Horizon.