@github/failbot
TypeScript icon, indicating that this package has built-in type declarations

0.8.3 • Public • Published

Failbot JS

A Failbotg client for JavaScript.

Installation

This package is published to npm as @github/failbot.

❯ npm install @github/failbot

Usage:

const {Failbot, HTTPBackend, LogBackend} = require('@github/failbot')

const failbot = new Failbot({
  app: 'my-cool-app',
  backends: [new HTTPBackend({haystackURL: process.env.HAYSTACK_URL}), new LogBackend({log: console.log.bind(console)})]
})

try {
  riskyThing()
} catch (error) {
  failbot.report(error, {
    extra: 'metadata',
    can: 'be',
    passed: 'as well'
  })
}

In order to attribute reported exceptions to service catalog services, the catalog_service tag is included in all exceptions reported via this library. Since all moda deployments have an OTEL_SERVICE_NAME environment variable, catalog_service is included in every failbot report payload as the value of OTEL_SERVICE_NAME.

You should not need to override this value but, if you do, you can pass catalogService to the Failbot constructor: const failbot = new Failbot({app: 'my-app', serviceCatalog: 'my-catalog', backends: ...}). Be aware that overriding this value may make it impossible for your team to receive alerts related to high volumes of exceptions.

Readme

Keywords

none

Package Sidebar

Install

npm i @github/failbot

Weekly Downloads

2,559

Version

0.8.3

License

MIT

Unpacked Size

20.7 kB

Total Files

31

Last publish

Collaborators

  • manuelpuyol
  • jonrohan
  • broccolini
  • primer-css
  • keithamus
  • gracepark
  • jibrangarcia
  • arelia
  • colebemis
  • smockle
  • simurai
  • khiga8
  • dustin.greif
  • srt32
  • githubbot
  • jfuchs
  • andrialexandrou
  • bteng22
  • dustin.savery