Whitelisting domains to gather errors from (JS)
benbracha
Posted on
May 08 2015
Hey,
Is there a way to specify relevant domain/sub-domains to collect errors from? For example, we don't want that our local-dev environments errors will be collected and take up of Raygun plan's quota. Also - is there a way to see different statistics for errors from different domains? For example we want to differentiate errors collected from automated-testing environment and production environment.
Thanks
Callum
Posted on
May 12 2015
Indeed there is - try setting the excludedHostnames value in the init options parameter:
Raygun.init('apikey', { excludedHostnames: ['localhost', '.dev'] }).attach();
The elements in the array can be strings or regular expressions which will match on the current (sub)domain that the browser is at. There's also an excludedUserAgents param if you want to ignore certain environments e.g PhantomJS.
The recommended way to see bucketed statistics for different environments is to have multiple 'applications' in Raygun, and set the API key based on some transformation depending on where it is deployed to. In this way the counts over time for the errors will be visible on the Global Dashboard, bucketed into the separate dev and production environments, and the individual errors will be viewable on their separate dashboard.
You can also use the application switcher hotkey "~" (tilde) to quickly open and filter the list by environment.