Error tracking

Error tracking helps to find errors in production or staging environments and fix them before they have a large impact on the system. We use Sentry for tracking errors on the backend, frontend and react-native apps, and Crashlytics for native apps.

Sentry

We use Sentry because it is reliable, is easy to integrate, supports source-maps for JavaScript, allows notifications customization.

Setting up on backend

Setting up Sentry on the backend is a trivial task. Sentry provides SDKs for Ruby, Python, Node.js and other platforms. Sentry also allows custom events tracking, adding additional event information, tags.

For more information on Node.js error tracking, read Node.js Error Tracking.

Setting up on frontend

Setting up Sentry on frontend is a matter of adding SDK.

Source-maps

If JavaScript application uses transpiler such as Babel or code minifier such as UglifyJS, error backtrace could be unreadable. Sentry supports JavaScript source-maps to help developers understand where the error happened, by showing original source code, instead of minified or transpiled code. Since source-maps reveal original source code, which can’t be exposed to the public, Sentry allows uploading source-maps for each release. To simplify this procedure, there are plugins such as webpack-sentry-plugin which automatically creates a new release on Sentry and uploads source maps, which can later be deleted from the server.

Tips and tricks

  • When native application crashes, the error is uploaded only when the app is launched again.