Check out our guides and API reference documentation on how to use Rollbar to monitor, debug, and triage errors.

Guides & SDKs    API Reference


Rollbar SDK for Go

rollbar-go is a Golang Rollbar client that makes it easy to report errors to Rollbar with full 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, we use the stack information from where the error was reported.


package main

import (

func main() {
  rollbar.SetEnvironment("production")                 // defaults to "development"
  rollbar.SetCodeVersion("v2")                         // optional Git hash/branch/tag (required for GitHub integration)
  rollbar.SetServerHost("web.1")                       // optional override; defaults to hostname
  rollbar.SetServerRoot("") // path of project (required for GitHub integration and non-project stacktrace collapsing)

  rollbar.Info("Message body goes here")

func doSomething() {
  var timer *time.Timer = nil
  timer.Reset(10) // this will panic


API docs on

Running Tests

For full integation tests, set up a dummy project in Rollbar and pass the access token as an environment variable to go test:


and verify the reported errors manually.

For coverage results, run:

TOKEN=POST_SERVER_ITEM_ACCESS_TOKEN go test -coverprofile=cover.out
go tool cover -html=cover.out -o cover.html

Help / Support

If you run into any issues, please email us at [email protected].

For bug reports, please open an issue on GitHub.

Updated 2 years ago


Rollbar SDK for Go

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.