This add-on is operated by Raygun
User-centric front-end performance monitoring.
Raygun Real User Monitoring
Last updated September 03, 2020
Table of Contents
Raygun Real User Monitoring (RUM) provides insights into the front-end performance of your application, enabling you to understand how performance is impacting the user experience.
Real User Monitoring enables you to:
- Identify and resolve performance issues
- Get instance-level insights into every user session
- Measure the impact of performance optimizations
- See how users are interacting with your application
Provisioning the add-on
Raygun Real User Monitoring can be attached to a Heroku application via the CLI:
A list of all plans available can be found here.
$ heroku addons:create raygun-rum:rum-free --app your-app-name
Created raygun-rum-kiwi-9001
After you provision Raygun Real User Monitoring, the RAYGUN_RUM_APIKEY
config var is available in your app’s configuration. It contains the API key used to send data to Raygun. You can confirm this via the heroku config:get
command:
$ heroku config:get RAYGUN_RUM_APIKEY --app your-app-name
your_api_key_here
Configuring your application
After you install Raygun Real User Monitoring, your application will need to be configured to fully integrate with the add-on.
STEP 1 - Install the client library
Using our CDN:
Add this snippet to your markup, before the closing <head/>
tag:
<script type="text/javascript">
!function(a,b,c,d,e,f,g,h){a.RaygunObject=e,a[e]=a[e]||function(){
(a[e].o=a[e].o||[]).push(arguments)},f=b.createElement(c),g=b.getElementsByTagName(c)[0],
f.async=1,f.src=d,g.parentNode.insertBefore(f,g),h=a.onerror,a.onerror=function(b,c,d,f,g){
h&&h(b,c,d,f,g),g||(g=new Error(b)),a[e].q=a[e].q||[],a[e].q.push({
e:g})}}(window,document,"script","//cdn.raygun.io/raygun4js/raygun.min.js","rg4js");
</script>
Or manually:
Download the production script (minified), the development script (full source) or see here for installing with npm
STEP 2 - Enable Real User Monitoring
Add the following lines of JS code just before the closing body tag in your site or app:
<script type="text/javascript">
rg4js('apiKey', 'RAYGUN_RUM_APIKEY'); // Enter your RAYGUN_RUM_APIKEY here.
rg4js('enablePulse', true);
</script>
STEP 3 - Browse your application
We recommend browsing to your application right now to test that everything is wired up correctly. Raygun will begin collecting and reporting data within a few minutes.
Additional options:
Single Page Applications:
You can track SPA view changes with thetrackEvent
function:
rg4js('trackEvent', { type: 'pageView', path: 'url/goes/here' });
For more examples on how to use the trackEvent
function, see the Single Page Application documentation.
The language guides in the Raygun documentation provide detailed information about installation, configuration, and additional features.
Using Real User Monitoring
For more information on getting the most out of using Raygun, see our Real User Monitoring documentation
You can access the application via the CLI:
$ heroku addons:open raygun-rum-kiwi-9001 --app your-app-name
Opening raygun-rum-kiwi-9001
Alternatively, visit the Heroku Dashboard and select your application. Once here, you can navigate to Raygun Real User Monitoring from the Add-ons menu.
Migrating between plans
Use the heroku addons:upgrade
command to migrate to a new plan.
$ heroku addons:upgrade raygun-rum:business --app your-app-name
--> Changing raygun-rum-kiwi-9001 on your-app-name from raygun-rum:rum-free to raygun-rum:rum-business
Your plan changes have been successfully applied
Removing the add-on
You can remove Raygun Real User Monitoring via the CLI:
This will destroy all associated data and cannot be undone!
$ heroku addons:destroy raygun-rum-laser-kiwi-9001 --app your-app-name
Destroying raygun-rum-kiwi-9001 on your-app-name... done
Support
All Raygun Real User Monitoring support and runtime issues should be submitted via one of the Heroku Support channels. Any non-support related issues or product feedback is welcome at the Raygun forums.