Using Airbrake with Express.js
This example Node.js application uses Express.js and sets up Airbrake to report errors and performance data. To adapt this example to your app, follow these steps:
- Install the package:
- Includethe required Airbrake libraries in your app.js :
- ConfigureAirbrake with your project's credentials:
- This middleware should be added before any routes are defined:
- The error handler middleware should be defined last. For more info on how thisworks, see the official Express error handling doc.
- The last step is to run your app. To test that you've configured Air brake correctly, you can throw an error inside any of your routes:
Any unhandled errors that are thrown will now be reported to Airbrake. See the basic usage to learn how to manually send errors to Airbrake.
Note: To see this all in action, take a look at our example app.js file and to run the example, follow the next steps.
Running the example app
If you want to run this example application locally, follow these steps:
- Clone the airbrake-js repo:
- Navigate to this directory:
- Run the following commands while providing your `project ID` and `project API key`
Frictionless error monitoring for Express
You monitor your servers and your apps, but is anyone monitoring your user experience? Every minute that your customer experience is compromised costs you more than just money. It costs you goodwill. Airbrake Express Error Monitoring can help.
Capturing Express errors is easy with the Airbrake Express Error Monitoring and Debugging tool. Airbrake installs in minutes and monitors your Express applications 24 hours/day, 7 days/week, notifying you in real-time of new errors occurrences. Detailed stack traces, environment, and user reports make Express error handling simple. With Airbrake, there's no need to sift through massive log reports for that elusive error. Instead, you’ll receive instant insight into the line of code that broke, the environment in which it occurred, and the deployment it's tied to.
Airbrake makes drilling down and understanding what's happening with your Express app easy. You can quickly fix error issues using:
Stack traces, parameters, and affected users - locate, assess, and resolve errors in a timely manner
- Find exactly where an error is and the code that led up to it with Airbrake stack traces.
- Parameters make it simple to group errors by their severity tags.
- See who was affected by an error with aggregations comprising of remote addresses, countries, browsers, server hostnames, and more.
Error trends and deploy tracking - simplifying the job of managing and triaging errors
- Deploy tracking is perfect when you need to see the relationship between errors and deploys.
- The “Deploy” tab simplifies error data into graphs.
- Keep track of who is pushing what deploys and any errors that are introduced.
- Discover increases and decreases in errors via the “Trends” tab.
Custom workflow integrations - collaborate with your team to prioritize and triage errors
- Integrate with your favorite application such as Slack, Trello, GitHub, etc.
- Leave comments for your team about specific errors using the Airbrake comment feature.
- Customize notifications to ensure you only receive messages about errors that matter.
- Mute any errors you already know about or are considered low priority.
Performance monitoring - keep a close eye on the health of your Express application
- Airbrake Express Performance Monitoring works with your application to monitor its health.
- With Performance Monitoring for developers, you’ll have access to important tools which measure the UX of your application, latency, and error occurrences.
- Under the “Jobs” tab, see a list of your Jobs and how well they’re performing within your application.
Security - Airbrake offers robust security to protect your data
- Airbrake is certified in all of the following areas: GDPR, EU-US Privacy Shield Framework, and SOC II Type 2.
- Airbrake supports both TLS Protocol v. 1.2 and v. 1.3.
- Use SAML Single-Sign-On to access your Airbrake Account.
Finding the root cause of your application exceptions is easier than ever with Airbrake Express. Airbrake assists you in locating an error's file, the method, and even the line of code. With proprietary and customizable grouping algorithms, cutting through the noise and focusing on fixing the errors that matter most has never been so easy. Let Airbrake help you handle errors so you can get back to the business of delighting your users. Try Airbrake free with a free trial; no credit card required!
This will make the text black in colour with the font, Inconsolata.
This will make the text pink in colour with the font, Inconsolata.
This is the h6 heading.
This will make the text black in colour with the font, Inconsolata; size 20px.
This will make the text yellow in colour with the font, Inconsolata; size 20px.