What is rollbar?
Rollbar is a real-time error tracking and monitoring tool for JavaScript applications. It helps developers to detect, diagnose, and fix errors in their applications by providing detailed error reports and notifications.
What are rollbar's main functionalities?
Error Tracking
Rollbar can automatically capture and report uncaught exceptions and unhandled promise rejections. This helps in tracking errors that occur in the application.
const Rollbar = require('rollbar');
const rollbar = new Rollbar({
accessToken: 'YOUR_ACCESS_TOKEN',
captureUncaught: true,
captureUnhandledRejections: true
});
// Example of tracking an error
try {
throw new Error('Test error');
} catch (e) {
rollbar.error(e);
}
Custom Logging
Rollbar allows custom logging of messages, warnings, and info messages. This can be useful for tracking specific events or conditions in the application.
const Rollbar = require('rollbar');
const rollbar = new Rollbar({
accessToken: 'YOUR_ACCESS_TOKEN'
});
// Log a custom message
rollbar.log('Custom log message');
// Log a warning
rollbar.warning('This is a warning');
// Log an info message
rollbar.info('This is an info message');
Telemetry
Rollbar can capture telemetry data such as console logs, network requests, and DOM events. This helps in understanding the context in which an error occurred.
const Rollbar = require('rollbar');
const rollbar = new Rollbar({
accessToken: 'YOUR_ACCESS_TOKEN',
captureUncaught: true,
captureUnhandledRejections: true,
autoInstrument: true
});
// Example of adding custom telemetry data
rollbar.configure({
payload: {
telemetry: [
{ type: 'log', level: 'info', body: 'Custom telemetry data' }
]
}
});
Other packages similar to rollbar
sentry
Sentry is another popular error tracking and monitoring tool. It provides similar functionalities to Rollbar, including real-time error tracking, performance monitoring, and detailed error reports. Sentry also supports a wide range of programming languages and frameworks.
airbrake
Airbrake is an error monitoring tool that provides real-time error tracking and detailed error reports. It offers similar features to Rollbar, such as capturing uncaught exceptions and custom logging. Airbrake also integrates with various development tools and services.
bugsnag
Bugsnag is an error monitoring tool that helps developers to detect, diagnose, and fix errors in their applications. It provides similar functionalities to Rollbar, including real-time error tracking, custom logging, and detailed error reports. Bugsnag also offers features like user tracking and release tracking.
Rollbar.js
Proactively discover, predict, and resolve errors in real-time with Rollbar’s error monitoring platform. Start tracking errors today!
Key benefits of using Rollbar.js are:
- Cross platform: Rollbar.js supports both server-side and client-side Javascript, including frameworks such as React, Angular, Express, Next.js and more.
- Telemetry: The telemetry timeline provides a list of “breadcrumbs” events that can help developers understand and fix problems in their client-side javascript. Learn more about telemetry.
- Automatic error grouping: Rollbar aggregates Occurrences caused by the same error into Items that represent application issues. Learn more about reducing log noise.
- Advanced search: Filter items by many different properties. Learn more about search.
- Customizable notifications: Rollbar supports several messaging and incident management tools where your team can get notified about errors and important events by real-time alerts. Learn more about Rollbar notifications.
Setup Instructions
- Sign up for a Rollbar account.
- For client-side Javascript, follow the Browser Quick Start instructions. For Node.js, follow the Server Quick Start.
Usage and Reference
For complete usage instructions and configuration reference, see our Javascript SDK docs.
Release History & Changelog
See our Releases page for a list of all releases, including changes.
Help / Support
If you run into any issues, please email us at support@rollbar.com.
For bug reports, please open an issue on GitHub.
Developing
To set up a development environment, you'll need Node.js and npm.
git submodule update --init
npm install -D
make
To run the tests, run make test
.
Contributing
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am 'Added some feature'
). - Push to the branch (
git push origin my-new-feature
). - Create a new Pull Request.