Setting up applications in Raygun for optimal error monitoring
Posted Jul 21, 2022 | 4 min. (677 words)Error monitoring doesn’t have to be difficult, and setting up Raygun is super simple. All it takes is a few short lines of code added to your application and a few minutes of your time. However, once you’re reporting errors successfully, you might be wondering how best to set things up with all the other moving parts of your applications. (Or as a first-time user, you might just be trying to figure out exactly what an “application” refers to in Raygun).
Here, we’ll detail best practices when setting up applications in Raygun and how they correspond to your own applications.
What defines an application in Raygun?
Each application you create in Raygun has a unique and separate API key. It’s this API key that tells Raygun where to send the error report when we receive it. Essentially, your API key provides a way to group errors into containers, and organize and sort them, like a filing system for your errors.
Add applications in Raygun for each language and platform
Now, if you really wanted to have one Raygun application monitoring your entire stack then you could. However, using one Raygun application and one API key means that all errors from your product are contained under the same Raygun application. When viewing your Raygun dashboard, you’d see errors from all sorts of languages, platforms, environments and URLs. Not very useful, right? When looking for the highest priority issues, it’s going to be far better to have things broken down into logical categories and separated from each other.
What’s the best way to set this up?
It’s best to set up multiple applications and have multiple API keys for each part of your application. For example, if your backend is built in Node.js, you want to monitor Javascript errors on your front end website, and you also have an iOS and Android app to monitor, you can use multiple applications to sort errors by programming language and platform, as well as optimal grouping logic and custom setup options for each language.
What about environments?
Want to see errors specifically from dev, test and production environments? No problem! You can do this by creating additional applications and therefore having separate API keys for each environment. Adding things like custom properties to error messages on the fly provides a clunky and poor user experience. Multiple applications set up to handle environments offers a far better user experience and makes sure everything is kept neat and tidy, while per-application notification rules allow you to be notified by environment (like production, when things are affecting your users!). Separate applications can also be viewed on your custom dashboard/s.
Built for teams
If different teams in your org are tasked with looking after specific parts of a large website, use separate API keys for each section of your site, reporting errors into separate Raygun applications that the relevant team can monitor.
What if I still only want to set up one Raygun application for all my environments?
You could use tags for this and filter the dashboard (the filters then apply to the groups too, so you could just drill into the groups and see the instances tagged with the environment variable). The decision to make a new app is entirely yours. If you have a small team, you may want to have them all together, while if it’s a large team you may want to break them apart. The benefits of breaking apart apps are:
- Notifications are controlled at the per-app level
- Integrations are managed at the per-app level
- Visibility to teams is managed at the per-app level
However, if you’re comfortable with those being all in one, you could send data in from the backend along with the front end data. Your call!
Still got questions about the best way to set up you applications?
Feel free to hit the Contact Raygun link on the Raygun dashboard to get in touch with us!
Don’t have a Raygun account yet? It takes a few moments to get started with a free 14 day trial.**