Giter Club home page Giter Club logo

yeller_node's Introduction

yeller_node

Yeller notifier for node.js

Get started: report errors to yeller in 30 seconds

var yeller = require('./yeller_node')
var yellerClient = yeller.client({token: 'YOUR_API_TOKEN_HERE'})
yellerClient.report(new Error('an message'));

Including additional information

Often you'll want to include more information about what was going on when the error happened

yellerClient.report(new Error('an message'),
 {location: 'myhandler', url: 'http://example.com'
  customData: {userID: 1}});

Here are the available options that you can pass to report to give additional information:

  • location: the name of what kind of program was running when this error happened. For http requests, this might be the name of the handler, for background jobs, the name of the job, etc
  • url (http only): the url of the http request that caused this error
  • customData: this is an arbitrary JSON hash of any information you want to send along with the error. Typical suspects: http params, http session, current job params, data about the currently logged in user, etc

Alongside options to report, you can pass some other options to client:

  • applicationEnvironment: a string that denotes what kind of environment the application is running in. This defaults to production, but you might want to change it to staging, development, or test etc
  • developmentEnvironments: an array of environments in which yeller should ignore errors. This lets you use yeller in your production code without it reporting errors when your tests fail etc.
  • host: a string that denotes which server the error happened on. By default yeller_node reads this from os.hostname.

Error Handling

yeller_node (like all other supported yeller clients) does smart retrying when nodes fail- so if one of yeller's backend servers is down, you won't lose errors.

For detecting when an error happens whilst yeller is reporting an error, you can pass errorHandler to client like so:

var errorHandler = {
    ioError: function (err) {
                console.log(err);
            },
    authError: function (err) {
                console.log(err);
            },
};
var yellerClient = client({
  token: 'YOUR_API_TOKEN_HERE',
  errorHandler: errorHandler
});

This will log yeller errors to stdout. ioError happens when there's a failure talking to yeller's backend, authError happens when your yeller API token is invalid.

Questions

If you have any questions, feel free to shoot me an email, [email protected].

Bug Reports And Contributions

Think you've found a bug? Sorry about that. Please open an issue on Github, or email me at [email protected] and I'll check it out as soon as possible.

yeller_node's People

Contributors

tcrayford avatar

Watchers

 avatar James Cloos avatar

Forkers

sandfox

yeller_node's Issues

module throws for ?? reasons

Not entirely sure whats happening here, but so far it looks like our application is going bang, and then yeller is going bang too when we report it...

more info

The original error is being caused by some malformed JSON file

[2015-04-24T15:04:07.675Z]  WARN: exception-tracker/16876 on ip-10-72-139-28: yeller error [TypeError: Cannot call method 'lastIndexOf' of null]
[2015-04-24T15:04:07.677Z]  WARN: exception-tracker/16876 on ip-10-72-139-28: actual error [SyntaxError: /var/www/project-x/libs/payment/bannedDevicesList.json: Unexpected string]
/var/www/project-x/node_modules/yeller_node/index.js:9
    if (project_root && frame.fileName.lastIndexOf(project_root, 0) === 0 && f
                                       ^
TypeError: Cannot call method 'lastIndexOf' of null
  at formatFrames (/var/www/project-x/node_modules/yeller_node/index.js:9:40)
  at formatError (/var/www/project-x/node_modules/yeller_node/index.js:22:19)
  at [object Object].YellerClient.formatJSONError (/var/www/project-x/node_modules/yeller_node/index.js:61:19)
  at [object Object].YellerClient.report (/var/www/project-x/node_modules/yeller_node/index.js:118:19)
  at tell_ya (/var/www/project-x/libs/exception/index.js:36:23)
  at /var/www/project-x/node_modules/async/lib/async.js:570:21
  at /var/www/project-x/node_modules/async/lib/async.js:249:17
  at /var/www/project-x/node_modules/async/lib/async.js:125:13
  at Array.forEach (native)
  at _each (/var/www/project-x/node_modules/async/lib/async.js:46:24)
  at async.each (/var/www/project-x/node_modules/async/lib/async.js:124:9)
  at _asyncMap (/var/www/project-x/node_modules/async/lib/async.js:248:13)
  at Object.map (/var/www/project-x/node_modules/async/lib/async.js:219:23)
  at _parallel (/var/www/project-x/node_modules/async/lib/async.js:568:20)
  at Object.async.parallel (/var/www/project-x/node_modules/async/lib/async.js:598:9)
  at track (/var/www/project-x/libs/exception/index.js:41:11)
  at process.<anonymous> (/var/www/project-x/libs/shutdown/index.js:59:9)
  at process.g (events.js:180:16)
  at process.emit (events.js:95:17)
  at process._fatalException (node.js:295:26)
  at process._asyncFatalException [as _fatalException] (/var/www/project-x/node_modules/async-listener/glue.js:211:34)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.