Giter Club home page Giter Club logo

rollbar

rollbar is a Go Rollbar client that makes it easy to report errors to Rollbar with stacktraces. Errors are sent to Rollbar asynchronously in a background goroutine.

Because Go's error type doesn't include stack information from when it was set or allocated, rollbar uses the stack information from where the error was reported.

You may also want to look at:

  • stvp/roll - Simpler, synchronous (no background goroutine) with a nicer API.

Installation

Standard installation to your GOPATH via go get:

go get github.com/stvp/rollbar

Documentation

API docs on godoc.org

Usage

package main

import (
  "github.com/stvp/rollbar"
)

func main() {
  rollbar.Token = "MY_TOKEN"
  rollbar.Environment = "production" // defaults to "development"

  result, err := DoSomething()
  if err != nil {
    // Error reporting
    rollbar.Error(rollbar.ERR, err)
  }

  // Message reporting
  rollbar.Message(rollbar.INFO, "Message body goes here")

  // Block until all queued messages are sent to Rollbar.
  // You can do this in a defer() if needed.
  rollbar.Wait()
}

Running Tests

Set up a dummy project in Rollbar and pass the access token as an environment variable to go test:

TOKEN=f0df01587b8f76b2c217af34c479f9ea go test

And verify the reported errors manually in the Rollbar dashboard.

Other Resources

For best practices and more information on how to handle errors in Go, these are some great places to get started:

Contributors

Thanks, all!

  • @kjk
  • @nazwa
  • @ossareh
  • @paulmach
  • @Soulou
  • @tike
  • @tysonmote
  • @marcelgruber
  • @karlpatr
  • @sumeet
  • @dfuentes77
  • @seriousben

Rollbar's Projects

ace icon ace

Ace (Ajax.org Cloud9 Editor)

analytics.js icon analytics.js

The hassle-free way to integrate analytics into any web application.

ansible icon ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.

api-people-example icon api-people-example

Shows how to get the Person data for each occurrence of a given list of item ids

ators icon ators

ators: rewrite it in Rust™, blazingly fast, etc.

awesome-asgi icon awesome-asgi

A curated list of awesome ASGI servers, frameworks, apps, libraries, and other resources

batchelor icon batchelor

Create and process batch files for insert/update/delete operations.

blog-old icon blog-old

Source of the Rollbar blog. (Built on Octopress)

bootstrap icon bootstrap

The most popular front-end framework for developing responsive, mobile first projects on the web.

bullet icon bullet

help to kill N+1 queries and unused eager loading

cdnjs icon cdnjs

🌍 The best FOSS web front-end resource CDN

d3 icon d3

A JavaScript visualization library for HTML and SVG.

dataproc-templates icon dataproc-templates

Dataproc Serverless templates and pipelines for solving simple in-Cloud data tasks

docker icon docker

Docker - the open-source application container engine

docker-registry icon docker-registry

Registry server for Docker (hosting/delivering of repositories and images)

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.