Error Tracking
Catch and diagnose errors before your users report them.
What Gets Tracked
SkySignal automatically captures:
| Field | Description |
|---|---|
message | Error message |
stack | Full stack trace |
type | Error type (method, subscription, server) |
methodName | Method that threw (if applicable) |
userId | User who encountered the error |
timestamp | When the error occurred |
context | Additional context data |
host | Server 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
});
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
Enable/Disable Error Tracking
SkySignal.init({
apiKey: '...',
trackErrors: true, // Enable (default)
});
Capture Error Context
Include additional context with errors:
SkySignal.init({
apiKey: '...',
captureErrorContext: true, // Enable (default)
});
Ignore Specific Errors
Exclude certain errors from tracking:
SkySignal.init({
apiKey: '...',
ignoreErrors: [
'not-authorized', // Ignore by error code
/network timeout/i, // Ignore by message pattern
(error) => error.expected, // Custom filter function
],
});
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
- Go to Site Settings > Source Maps
- Enable "Source Map Support"
- 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:
- Error message (with variable parts normalized)
- Stack trace fingerprint
- 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
- Verify
trackErrors: true - Check if error matches
ignoreErrors - Ensure error is actually thrown (not just logged)
- Check network connectivity to SkySignal
Stack Traces Unreadable
- Upload source maps for your version
- Verify source map file names match
- Check source map upload succeeded
Next Steps
- Alerting - Get notified of errors
- Dashboard Overview - Navigate error data
- Troubleshooting - Common issues