Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Airbrake for your Go application #1

Open
pataiji opened this issue Apr 3, 2019 · 0 comments
Open

Setup Airbrake for your Go application #1

pataiji opened this issue Apr 3, 2019 · 0 comments
Labels

Comments

@pataiji
Copy link
Owner

pataiji commented Apr 3, 2019

Example Usage

To include Airbrake in your GoLang application you'll need to import the Gobrake code, available on our official GitHub repo

(You can find your project ID and API KEY with your project's settings):

package main

import (
    "errors"

    "github.com/airbrake/gobrake"
)

var airbrake = gobrake.NewNotifierWithOptions(&gobrake.NotifierOptions{
    ProjectId: <Your project ID>,
    ProjectKey: "<Your project ID>",
    Environment: "production",
})

func main() {
    defer airbrake.Close()
    defer airbrake.NotifyOnPanic()

    airbrake.Notify(errors.New("operation failed"), nil)
}

Check out our official GitHub repo for info on advanced features like ignoring errors and setting error severity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant