Code Monkey home page Code Monkey logo

mission-control-laravel-package's Introduction

Mission Control Laravel Package

Build Status Packagist license

Mission Control Laravel Package - Send data to Grafite's Mission Control system to stay in control of your applications.

Grafite's Mission Control is an elegant Application Performance Management system. Forget being inundated with hundreds of charts and complex configurations for CMS websites, custom E-commerce platforms etc. Utilize the simple user interface, with specific data for high demand moments. Get notifications within minutes of your system being overloaded, or high levels of errors being triggered. Set it up in less than 5 minutes with your next deployment, and take back your weekends.

Requirements

  1. PHP 7.3+

Composer

composer require grafite/mission-control-laravel

Environment Variables

You need to add these variables to your environment. These will be the format for apps deployed with Laravel FORGE.

Just remember you need to enable the logs on your server - see below for info

MISSION_CONTROL_USER_TOKEN={api_token}
MISSION_CONTROL_PROJECT_KEY={project_key}
MISSION_CONTROL_PROJECT_UUID={project_uuid} // required for JS error reporting

Publishing Configuration

php artisan vendor:publish --provider="Grafite\MissionControlLaravel\GrafiteMissionControlLaravelProvider"

Blade Directives

You may wish to tap into the JavaScript error reporting feature. If so you need to do simply add the following to your header:

@missionControl

It will inject a JS error trace with an window listener for errors.

Issues

By default Mission Control will log all exceptions and logs from any environment you specify in the config. You can disable this by removing all environments. Otherwise you can log things manually.

Issues lets you peak into your exceptions or any flagged messages you'd like to track. You can do so using the following methods:

use Grafite\MissionControlLaravel\Issue;

try {
    // do some code
} catch (Exception $e) {
    app(Issue::class)->exception($e);
}

Or if you just want to flag an potential issue or concern in your applicaiton:

use Grafite\MissionControlLaravel\Issue;

app(Issue::class)->log('Anything you want to say goes here', 'tag');
Tags

Tags can be any terminology you want, to help sort through your issues.

Notify

You can easily give yourself tagged notifications for your applications throuh this handy service:

use Grafite\MissionControlLaravel\Notify;

app(Notify::class)->send('This is a title', 'info', 'This is a custom message');

Mission Control Report

The Report CRON job for Mission Control lets you send back to Mission Control data about the performance of your application.

Then if you're using FORGE (default setup) you can add the following to the Scheduled Jobs:

COMMAND: php /home/forge/{domain}/artisan mission-control:report
USER: forge
FREQUENCY: Custom
CUSTOM SCHEDULE: */5 * * * *

Forge Screenshot

If not simply add this to your CRONTAB:

*/5 * * * * php /{app-path}/artisan mission-control:report

For Security Measures

COMMAND: php /home/forge/{domain}/artisan mission-control:virus-scan
USER: forge
FREQUENCY: Custom
CUSTOM SCHEDULE: 0 1 * * *

Install ClamAV

sudo apt-get install clamav clamav-daemon mailutils -y
sudo service clamav-freshclam stop
sudo freshclam

PHPUnit Settings

Your tests may begin to fail, if this happens just add these environment variables to your phpunit.xml files. You can also add them directly to your CI tool of choice.

<env name="MISSION_CONTROL_USER_TOKEN" value="testing"/>
<env name="MISSION_CONTROL_PROJECT_KEY" value="testing"/>

License

Mission Control PHP Package is open-sourced software licensed under the MIT license

Bug Reporting and Feature Requests

Please add as many details as possible regarding submission of issues and feature requests

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

mission-control-laravel-package's People

Contributors

mlantz avatar sudden-break avatar

Stargazers

 avatar  avatar

Watchers

 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.