Skip to main content

Error Tracking

Catch and diagnose errors before your users report them.

What Gets Tracked

SkySignal automatically captures:

FieldDescription
messageError message
stackFull stack trace
typeError type (method, subscription, server)
methodNameMethod that threw (if applicable)
userIdUser who encountered the error
timestampWhen the error occurred
contextAdditional context data
hostServer that threw the error

Error Sources

Method Errors

Errors thrown in Meteor Methods are automatically captured:

Meteor.methods({
'orders.create': function(data) {
if (!this.userId) {
// This error is automatically tracked
throw new Meteor.Error('not-authorized', 'You must be logged in');
}
// ...
}
});

Subscription Errors

Errors in publications:

Meteor.publish('privateData', function() {
if (!this.userId) {
// Automatically tracked
throw new Meteor.Error('not-authorized');
}
return PrivateData.find({ userId: this.userId });
});

Unhandled Exceptions

Server-side unhandled exceptions:

// Uncaught errors are automatically captured
process.on('uncaughtException', (err) => {
// SkySignal captures this
});

Client-Side Error Tracking

The agent automatically captures client-side errors in the browser. It registers listeners on window.onerror and the unhandledrejection event, so uncaught exceptions and unhandled Promise rejections are picked up without any extra code on your part.

Captured errors are batched and sent to the SkySignal backend via the /api/v1/errors endpoint. Each error includes the message, stack trace, URL, user agent, and the current user ID (if logged in).

Configuration

Client-side error tracking is configured under settings.public.skysignal.errorTracking in your Meteor settings file:

OptionTypeDefaultDescription
enabledBooleantrueEnable/disable client error capture
captureUnhandledRejectionsBooleantrueCapture unhandled Promise rejections
debugBooleanfalseLog captured errors to console (useful during development)

Example Settings

{
"public": {
"skysignal": {
"publicKey": "pk_live_xxx",
"errorTracking": {
"enabled": true,
"captureUnhandledRejections": true
}
}
}
}

To disable client-side error tracking entirely (for example, if you only want server-side error monitoring):

{
"public": {
"skysignal": {
"publicKey": "pk_live_xxx",
"errorTracking": {
"enabled": false
}
}
}
}

During development, turn on debug to see what the agent captures before it sends to the backend:

{
"public": {
"skysignal": {
"publicKey": "pk_dev_xxx",
"errorTracking": {
"enabled": true,
"debug": true
}
}
}
}

What Gets Captured

For each client-side error, the agent records:

FieldDescription
messageError message
stackStack trace (if available)
type"client"
urlPage URL where the error occurred
userAgentBrowser user agent string
userIdLogged-in user ID (if available)
timestampWhen the error occurred
source"window.onerror" or "unhandledrejection"

Client-side errors show up alongside server errors in the Errors tab, tagged with type client so you can filter them separately.

Viewing Error Data

Errors Dashboard

Navigate to your site's Errors tab to see:

  • Error Timeline - Errors over time
  • Error Groups - Errors grouped by message/type
  • Error Rate - Percentage of requests that error
  • Recent Errors - Latest error occurrences

Error Details

Click on any error group to see:

  • Full stack trace
  • Error context and metadata
  • Affected users
  • Historical frequency
  • Related method/subscription

Configuration

All error tracking configuration goes in your settings.json file -- the agent reads it from Meteor's settings system automatically.

Enable/Disable Error Tracking

Server-side error tracking is controlled by collectErrors in your private settings:

{
"skysignal": {
"apiKey": "sk_live_xxx",
"collectErrors": true
}
}

Client-side error tracking is controlled separately under the public settings (see Client-Side Error Tracking above).

Ignore Specific Errors

You can exclude certain errors from tracking using the ignoreErrors array in your client-side error tracking config. This accepts exact error message strings:

{
"public": {
"skysignal": {
"publicKey": "pk_live_xxx",
"errorTracking": {
"enabled": true,
"ignoreErrors": [
"not-authorized",
"network timeout"
]
}
}
}
}

Source Maps

Enable source map support for readable stack traces:

Upload Source Maps

After building your app, upload source maps:

# Using the SkySignal CLI
skysignal sourcemaps upload \
--api-key $SKYSIGNAL_API_KEY \
--version 1.0.0 \
./bundle/programs/server/*.js.map

Configure in Dashboard

  1. Go to Site Settings > Source Maps
  2. Enable "Source Map Support"
  3. Upload maps for each release

Adding Context

Automatic Context

SkySignal automatically captures:

  • User ID and session info
  • Request/method details
  • Server hostname
  • Timestamp

Custom Context

Add custom context to errors:

// Add context globally
SkySignal.setContext({
environment: 'production',
region: 'us-east-1',
});

// Add context to specific error
try {
processOrder(orderId);
} catch (error) {
SkySignal.captureError(error, {
orderId,
step: 'payment-processing',
});
throw error;
}

Manual Error Capture

Capture errors that you handle gracefully:

try {
await riskyOperation();
} catch (error) {
// Log to SkySignal without re-throwing
SkySignal.captureError(error, {
severity: 'warning',
handled: true,
});

// Handle gracefully
return fallbackValue;
}

Error Grouping

SkySignal groups errors by:

  1. Error message (with variable parts normalized)
  2. Stack trace fingerprint
  3. Error type/code

This prevents duplicate errors from flooding your dashboard.

Best Practices

1. Use Meteor.Error for Expected Errors

// Good: Provides error code for grouping
throw new Meteor.Error('validation-failed', 'Email is invalid');

// Less ideal: Generic error
throw new Error('Email is invalid');

2. Add Meaningful Context

SkySignal.captureError(error, {
userId: Meteor.userId(),
action: 'checkout',
cartItems: cart.items.length,
});

3. Don't Ignore All Errors

Be selective about what you ignore:

// Bad: Ignoring too much
ignoreErrors: [/.*/]

// Good: Specific patterns
ignoreErrors: [
'not-authorized', // Expected for logged-out users
/timeout/i, // Network issues
]

4. Set Up Alerts

Configure alerts for:

  • New error types
  • Error rate spikes
  • Critical error patterns

See Alerting Guide for setup instructions.

Troubleshooting

Errors Not Appearing

  1. Verify collectErrors: true in your server settings (or errorTracking.enabled: true in public settings for client errors)
  2. Check if error matches an ignoreErrors entry
  3. Ensure error is actually thrown (not just logged)
  4. Check network connectivity to SkySignal

Stack Traces Unreadable

  1. Upload source maps for your version
  2. Verify source map file names match
  3. Check source map upload succeeded

Next Steps