Monitor, troubleshoot, and optimize Meteor app performance with Atatus. No code changes required in your app. Start seeing hidden Meteor errors in minutes.
meteor add atatus:atatus
if (Meteor.isClient) {
Meteor.startup(function () {
AtatusNotifier.initialize({
client: {
licenseKey: "YOUR_LICENSE_KEY",
appName: "YOUR_APP_NAME",
options: {
tags: ['paid_user', 'premium'],
customData: {
name: 'John Doe',
plan: 'premium',
beta_access: true
},
version: '1.0.0'
}
},
trackUser: true
});
});
}
where client.licenseKey is your project's license key. client.options is an advanced configuration to atatus and it is optional. If you are using the Meteor Accounts package, you can enable user tracking on errors with trackUser option.
To track errors in Meteor server, you need to create Node.js APM project and install Atatus Node.js agent.
// Install Atatus Node Agent
npm install --save atatus-nodejs
if (Meteor.isServer) {
var atatus = require("atatus-nodejs");
// var atatus = Meteor.npmRequire("atatus-nodejs"); // For older meteor
atatus.start({
licenseKey: "YOUR_LICENSE_KEY",
appName: "YOUR_APP_NAME",
beforeErrorSend: function (payload) {
// Remove stack trace from error message.
if (payload.exceptions && payload.exceptions[0] &&
payload.exceptions[0].message) {
var message = payload.exceptions[0].message;
var atIndex = message.indexOf(' at');
if (atIndex > 10) {
message = message.substring(0, atIndex);
payload.exceptions[0].message = message;
}
}
return true;
}
});
var consoleLogOrig = console.log;
console.log = function (message) {
// special case for meteor dev mode
if(message === 'LISTENING') {
return consoleLogOrig.call(console, 'LISTENING');
}
if (typeof message === 'string' && message.indexOf('Exception') === 0) {
atatus.notifyError(message);
}
consoleLogOrig.apply(console, arguments);
};
}
Just reopen your app now. That's it! You've sent your first event.
Try it free. No credit card required. Instant set-up.
Best APM Monitoring tool
— S Herman Kiefus, DevOps Admin, Compass
Avail Atatus features for 14 days free-trial. No credit card required. Instant set-up.