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
});
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:
| Option | Type | Default | Description |
|---|---|---|---|
enabled | Boolean | true | Enable/disable client error capture |
captureUnhandledRejections | Boolean | true | Capture unhandled Promise rejections |
debug | Boolean | false | Log 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:
| Field | Description |
|---|---|
message | Error message |
stack | Stack trace (if available) |
type | "client" |
url | Page URL where the error occurred |
userAgent | Browser user agent string |
userId | Logged-in user ID (if available) |
timestamp | When 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
- 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
collectErrors: truein your server settings (orerrorTracking.enabled: truein public settings for client errors) - Check if error matches an
ignoreErrorsentry - 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