GithubHelp home page GithubHelp logo

rollbar's Introduction

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
  • @waltjones

rollbar's People

Contributors

awsmsrc avatar bpo avatar brianr avatar dfuentes77 avatar karlpatr avatar kjk avatar marcelgruber avatar matheuslc avatar nazwa avatar paulmach avatar ramin0 avatar soulou avatar southern avatar sumeet avatar tike avatar tysonmote avatar waltjones avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rollbar's Issues

How to install?

Hello. I think it would be worthwhile including a guide or a link to a guide in the readme. I'm just starting in the GoLang game and this would be helpful. If you provide guidance I can make the change request on the README file as I personally go through the process. Cheers.

Is there a way to auto report any occurrence of an app error?

I know this is possible as I've done it in other tech stacks. Currently I'm just reporting manually any place in my app that could throw an error. Which is about 50 occurrences. I suppose the question is, if we wanted to explore this, where would we likely put this code? Or is it not so simple in Go? I understand that errors can bubble up, and some errors can be repressed or handled before they bubble all the way up. But is there a way to inject the rollbar send code inside of the default error handler? Cheers

Raw POST body

Can you, please, include raw POST body (data.request.body) into request-related Occurrences, as per the spec? Or is it omitted intentionally (i.e. for field filtering)? It's a problem for me, because all my POST requests are sent as JSON and not form-urlencoded, so I can't see what goes wrong in the dashboard.

Let me know if you don't have time for this, I'll try patching this myself then (but would prefer not to, since I'm relatively new to Go).

would be cool to have updated releases

Last one was 2015.

Don't want to always pull from master.

For example, using glide, would like to only pull certain patch/minor versions based on our comfort.

Use actual error class name for default error type

Would you consider updating how class names are reported for "errors.errorString", or would you take a PR for this?

The Rollbar grouping team has made improvements to error grouping, however hashing the class name based on the message string causes grouping to fail. Any difference in the message string looks like a new error class.

This PR makes the recommended change in the rollbar-go package:
rollbar/rollbar-go#60

Related to the stvp/rollbar code here:
https://github.com/stvp/rollbar/blob/master/rollbar.go#L333-L335

Rollbar error: received response: 429 Too Many Requests

The service I working on sends errors to rollbar from a logrus hook and when there are a lot of errors I see this failure coming from Rollbar client:

Rollbar error: received response: 429 Too Many Requests

Is there a way to mitigate this issue?

Is there a way to ask Rollbar to print the errors in 'stderr' as well?

Maybe this already exists, or maybe its a feature request, but is there a way to tell Rollbar to print errors, warnings, etc to stderr as well as positing it to the remote server?

Would be a nice handy feature to have for us developers for who wants to see errors both locally but also on the web automatically, by using a single logging logic in our code.

Desgin of the message queue

Hi Tyson,

thanks for building and maintaining this library. It's very usefull.

When I looked into the code I was a little puzzled by the use of a single goroutine, non-blocking channel and sync.WaitGroup (in the init(), Wait() and push() functions).

Would you mind explaining a little bit what the aims (and possibly constraints) were that led you to implement the message queueing like this?
I'm asking, since I want to be sure I understand the problem correctly, before suggesting improvements I see.

Thanks and kind regards

Timo

Proxy

Hi,
Is it possible to configure this client to send data to rollbar via an http proxy?
Thanks,

Use in middleware

Hi,
I want propose add some rollbar in middleware usage for popular packages (gin, echo) and raw go usage. Its will be helpful for new peoples in go.

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.