spider-black-widowError Tracking

Mtrix's error tracking provides comprehensive monitoring of client-side errors, helping you identify, prioritize, and fix issues before they impact your users. This section covers how to implement and leverage error tracking in your application.

Enabling Error Tracking

Error tracking is disabled by default. Enable it during initialization:

mtrix.init({
  organizationId: 'your-organization-id',
  projectId: 'your-project-id',
  environment: 'production',
  options: {
    errorReporting: {
      tracking: true,
      captureTypes: ['exception', 'promise', 'network', 'console'],
      ignoreErrors: ['Script error.', /Chrome Extensions/],
      maxErrorsPerMinute: 10,
      recordStackTrace: true,
      recordContext: true
    }
  }
});

Types of Errors Captured

Mtrix can capture different types of errors based on your configuration:

Unhandled Exceptions

JavaScript exceptions that aren't caught in try-catch blocks:

Promise Rejections

Unhandled promise rejections:

Network Errors

Failed API requests and other network failures:

Console Errors

Errors logged to the console:

Error Data Structure

Mtrix collects comprehensive data for each error:

Manual Error Tracking

In addition to automatic capture, you can manually track errors:

Error Context & Breadcrumbs

Add custom context to help with debugging:

Integration with Session Recording

Mtrix can automatically trigger session recording when errors occur:

This creates a powerful debugging workflow:

  1. Error occurs and is captured by Mtrix

  2. Session recording is automatically triggered

  3. You can watch exactly what the user did before encountering the error

Error Grouping and Analysis

In the Mtrix dashboard, errors are automatically grouped based on:

  • Error message and type

  • File and line number

  • Stack trace similarity

This helps you focus on the most impactful issues:

Error Alerting

Configure alerts based on error frequency, impact, or specific conditions:

Alerts can be delivered via:

  • Email

  • Slack

  • PagerDuty

  • Webhook (for custom integrations)

Source Maps Integration

For accurate line numbers in minified code, upload source maps to Mtrix:

Client Implementation

This section provides detailed guidance on integrating Mtrix with various frontend frameworks and platforms.

JavaScript Integration

Basic HTML/JavaScript

For traditional websites without a frontend framework:

Using Module Bundlers

For projects using Webpack, Rollup, or other bundlers:

Last updated