All Projects → sir-dunxalot → ember-new-relic

sir-dunxalot / ember-new-relic

Licence: MIT License
Adds New Relic to your Ember CLI app based on the app's environment

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to ember-new-relic

ember-credit-card
"make your credit card form dreamy in one line of code"
Stars: ✭ 89 (+206.9%)
Mutual labels:  ember, ember-addon
ember-simple-auth-token
Ember Simple Auth extension that is compatible with token-based authentication like JWT.
Stars: ✭ 356 (+1127.59%)
Mutual labels:  ember, ember-addon
ember-google-charts
Google's Material charts made easy for Ember apps - http://sir-dunxalot.github.io/ember-google-charts/
Stars: ✭ 31 (+6.9%)
Mutual labels:  ember, ember-addon
ember-fsm
[Maintenance Mode] A promise-aware finite state machine implementation for Ember
Stars: ✭ 37 (+27.59%)
Mutual labels:  ember, ember-addon
ember-luxon
🕐 🌐 [deprecated] Addon thats brings Luxon to Ember applications.
Stars: ✭ 20 (-31.03%)
Mutual labels:  ember, ember-addon
ember-custom-actions
Custom API actions for Ember applications
Stars: ✭ 73 (+151.72%)
Mutual labels:  ember, ember-addon
ember-bootstrap-power-select
Integrate ember-power-select into your ember-bootstrap forms
Stars: ✭ 37 (+27.59%)
Mutual labels:  ember, ember-addon
ember-google-analytics-embed
An Ember Addon for adding analytics visualizations using the Google Analytics Embed API.
Stars: ✭ 26 (-10.34%)
Mutual labels:  ember, ember-addon
ember-changeset-conditional-validations
Conditional validations for ember-changeset-validations
Stars: ✭ 26 (-10.34%)
Mutual labels:  ember, ember-addon
ember-stripe-elements
A simple Ember wrapper for Stripe Elements.
Stars: ✭ 64 (+120.69%)
Mutual labels:  ember, ember-addon
ember-cli-daterangepicker
Just a simple component to use bootstrap-daterangepicker.
Stars: ✭ 32 (+10.34%)
Mutual labels:  ember, ember-addon
els-addon-typed-templates
Ember templates linting / autocomplete, based on Typescript language server
Stars: ✭ 27 (-6.9%)
Mutual labels:  ember, ember-addon
glimmer-apollo
Ember and Glimmer integration for Apollo Client.
Stars: ✭ 32 (+10.34%)
Mutual labels:  ember, ember-addon
ember-deep-set
Deeply set values on an Ember Object or POJO
Stars: ✭ 30 (+3.45%)
Mutual labels:  ember, ember-addon
ember-autoresize-modifier
Autoresize Element Modifier for Ember.js
Stars: ✭ 15 (-48.28%)
Mutual labels:  ember, ember-addon
ember-do-forms
ember-do-forms handles the icky parts of forms that you don't want to, and leaves the rest to you.
Stars: ✭ 18 (-37.93%)
Mutual labels:  ember, ember-addon
ember-shadow-dom
Write templates for your components inside of a Shadow DOM root.
Stars: ✭ 26 (-10.34%)
Mutual labels:  ember, ember-addon
ember-query-params
Ember service for your query params
Stars: ✭ 44 (+51.72%)
Mutual labels:  ember, ember-addon
ember-uikit
The ember implementation of UIkit
Stars: ✭ 24 (-17.24%)
Mutual labels:  ember, ember-addon
ember-rapid-forms
Smart, Intuitive forms for Ember.js styled with Bootstrap, Multi layouts and Validation support.
Stars: ✭ 58 (+100%)
Mutual labels:  ember, ember-addon

Ember New Relic Build Status npm

This Ember addon adds New Relic Browser to your app. All PRs and issues are welcome.

Installation

ember install ember-new-relic

Usage

Basic Usage

Add your applicationId and licenseKey to config/environment.js:

/* config/environment.js */

module.exports = function(environment) {
  environment === 'development';

  var ENV = {
    newRelic: {
      applicationId: '97bfuo3FFd3',
      licenseKey: 'ef234SgE4'
    }
  };
}

Configuration

You might also want to specify your agent, beacon, or other properties:

/* config/environment.js */

module.exports = function(environment) {
  environment === 'development';

  var ENV = {
    newRelic: {
      agent: 'js-agent.newrelic.com/nr-1016.min.js',
      applicationId: '97bfuo3FFd3',
      beacon: 'bam.nr-data.net',
      errorBeacon: 'bam.nr-data.net',
      licenseKey: 'ef234SgE4',
      spaMonitoring: true,
      sa: 1,
    }
  };
}

Value and descriptions for all of the above can be found in your New Relic Browser's application settings.

It is likely you will only have to set applicationId, licenseKey, and agent to match your New Relic code snippet.

SPA Monitoring

New Relic released SPA Monitoring on July 12th 2016. By default, this addon does not use SPA Monitoring.

If you want to use New Relic SPA Monitoring, you must enable spaMonitoring in your configuration as follows:

/* config/environment.js */

module.exports = function(environment) {
  environment === 'development';

  var ENV = {
    newRelic: {
      spaMonitoring: true,
    }
  };
}

This will replace the default New Relic code snippet with the New Relic SPA code snippet.

Environments

To enable New Relic Browser in certain environments, just include applicationId for those environments only:

/* config/environment.js */

module.exports = function(environment) {
  environment === 'development';

  var ENV = {
    newRelic: {
      licenseKey: 'ef234SgE4'
    }
  };

  if (environment !== test) {
    ENV.newRelic.applicationId = '97bfuo3FFd3';
  }
}

You can also use different application IDs for different environments:

/* config/environment.js */

module.exports = function(environment) {
  environment === 'development';

  var ENV = {
    newRelic: {
      licenseKey: 'ef234SgE4'
    }
  };

  if (environment === 'development') {
    ENV.newRelic.applicationId = '97bfuo3FFd3';
  } else if (environment === 'production') {
    ENV.newRelic.applicationId = 'f99FJ930sp';
  }
}

Manual Script Loading

By default the New Relic code snippet is imported into vendor.js.

If you want to manually import the snippet from an external JS file, configure ember-cli-build.js with ember-new-relic options as follows:

/* ember-cli-build.js */
module.exports = function(defaults) {
    var app = new EmberApp(defaults, {
      'ember-new-relic': {
        importToVendor: false
      }
    });

    return app.toTree();
};

Prepare your app/index.html with the New Relic script, placed above the vendor.js script as follows:

<script src="new-relic.js"></script>
<script src="assets/vendor.js"></script>

Change the Script Path

The New Relic code's default output path is new-relic.js, accessible at the root of the output folder.

If you want to change the output path, configure ember-cli-build.js with ember-new-relic options as follows:

/* ember-cli-build.js */
module.exports = function(defaults) {
    var app = new EmberApp(defaults, {
      'ember-new-relic': {
        outputPath: 'assets/new-relic.js'
      }
    });

    return app.toTree();
};

When used in conjunction with importToVendor disabled, remember to update the path in app/index.html.

Content Security Policy

To avoid browser errors, add the following to your CSP:

/* config/environment.js */

module.exports = function(environment) {
  environment === 'development';

  var ENV = {
    newRelic: {
      licenseKey: 'ef234SgE4',
      applicationId: '97bfuo3FFd3',
    },

    contentSecurityPolicy: {
      'connect-src': "'self' https://*.nr-data.net",
      'img-src': "'self' https://*.nr-data.net",
      'script-src': "'self' http://*.newrelic.com https://*.nr-data.net http://*.nr-data.net",
    },
  };
}

Development

Run the tests using ember test or by navigating to the /tests route in the browser.

Please accompany PRs for bugs and new functionality with test coverage.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].