Giter Site home page Giter Site logo

tvd0x2a / new-relic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from topshelfcraft/new-relic

0.0 0.0 0.0 43 KB

This plugin helps instrument your Craft app with New Relic APM by setting transaction names and (optionally) an App Name on each request.

License: Other

PHP 80.35% Twig 19.65%

new-relic's Introduction

New Relic

a plugin for Craft CMS

A Top Shelf Craft creation
Michael Rog, Proprietor

Instrument your Craft app with New Relic APM.


tl:dr

This plugin helps connect your Craft app with New Relic APM by setting transaction names and (optionally) an app name on each request.

Installation

  1. From your project directory, use Composer to require the plugin package:

    composer require topshelfcraft/new-relic
    
  2. In the Control Panel, go to Settings → Plugins and click the “Install” button for New Relic.

  3. Add a new-relic.php config file, edit the plugin Settings as needed.

The New Relic plugin is also available for installation via the Craft CMS Plugin Store.

Configuration

You can use the Control Panel settings screen to configure the plugin, or add a new-relic.php file to your Craft config directory:

<?php
return [

    /*
     * Specify a different app name than
     * the one provided in your .ini files,
     * e.g. If you want to change the app name
     * on a per-environment basis...
     */
    'appName' => '',
    
    /*
     * Specify a string to override Segment 2
     * from the request path, e.g. If you want to
     * consolidate your reported routes...
     */
    'groupSegment2As' => '',

];

Enabling/Disabling for Testing

Leaving New Relic enabled when running test suites may cause problems — particularly when using CLI tools like Codeception — because Craft's isConsoleRequest() method may return erroneously when bootstrapped in a testing context.

To disable New Relic during testing, add the plugin handle to disabledPlugins, in the general.php config file in your Testing setup:

<?php
return [
    // ...
    
    'disabledPlugins' => [
        'new-relic',
    ],
    
    // ...
];

If you specifically need to use New Relic while running tests, you'll need to explicitly tweak the request in your test bootstrap:

Yii:$app->request->setIsConsoleRequest(Yii:$app->request instanceof yii/console/Request);

What is New Relic?

New Relic provides tools for real-time monitoring and performance insight. When every aspect of your software and infrastructure is observable, you can can find and fix problems faster. New Relic APM (Application Performance Monitoring) helps you build, deploy, and maintain great software by providing detailed performance metrics for every aspect of your environment.

This plugin assumes you already have an account set up at newrelic.com and that you have installed the APM tool in your environment.

(This plugin is an unofficial companion to your New Relic setup for Craft. New Relic APM is a trademark of New Relic, Inc.)

Support

What are the system requirements?

Craft 4.0+ and PHP 8.0+

I found a bug.

Suuuuure you did.

I triple-checked. It's a bug.

Well then, thanks for looking out for me. Please open a GitHub Issue or submit a PR to the 4.x.dev branch.


Contributors:

new-relic's People

Contributors

michaelrog avatar ibrahimlawal 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.