Golang Error Tracking

This is a blog about the development of Yeller, The Exception Tracker with Answers

Read more about Yeller here

Yeller gets its first new supported language since launch today: Go

Go has been around a while now, and is becoming increasingly popular for writing high performance stuff. The toolchain is fantastic for a relatively new language, actually on par or better with the JVM or any other platform I’ve used.

Now error handling in Go is significantly different from the other languages Yeller supports. In those, it’s much more likely to have an exception bubble up to the top level. Go does have something like exceptions, with panic and recover, but the usual error handling style is to use multiple return values, like so:

file, err := os.Open("filename.ext")
if err != nil {
  // do something here

Often this error handling style promotes much clearer thinking about what’s going on in your app. Usually though, there’s a lot of “and then return this error to the caller of this function”, which unwinds the stack.

That’s fine, but what do you do when you hit the top of the stack? Do you shove the error in a log file somewhere? That’s not good enough for production - it doesn’t let you see how often an error is happening, you don’t get a full stacktrace, and it’s difficult to diagnose errors if they’ve happened thousands of times.

What you really need is real error tracking and analysis.

That’s what Yeller does. It captures errors from your app, and lets you diagnose them quickly. Today it ships with full support for go.

Handling an error is simple, it looks like this:

file, err := os.Open("filename.ext")
if err != nil {
        info := make(map[string]interface{})
        info["filename"] = "filename.ext"
        yeller.NotifyInfo(err, info)

You can attach any information that the standard library’s JSON formatting knows how to handle, and we’ll do advanced analysis to tell you if that data is unique across all occurrences of an error. Yeller also has support for grabbing useful information out of net/http requests, so you get parameters and so on logged by default.

Learn more about Yeller’s Go Support

Start Using Yeller to Track your Go Errors Today

This is a blog about the development of Yeller, the Exception Tracker with Answers.

Read more about Yeller here

Looking for more about running production applications, debugging, Clojure development and distributed systems? Subscribe to our newsletter: