Skip to content
Error handler integration for Sentry (both hosted and on-premise)
Go Makefile Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
etc/sentry
.editorconfig
.env.test.dist
.gitignore
.golangci.yml
CHANGELOG.md
LICENSE
Makefile
README.md
docker-compose.override.yml.dist
docker-compose.yml
go.mod
go.sum
handler.go
handler_integration_test.go
handler_test.go

README.md

Sentry handler

CircleCI Go Report Card GolangCI GoDoc

Error handler integration for Sentry.

Installation

go get handler.emperror.dev/sentry

Usage

package main

import (
	"handler.emperror.dev/sentry"
)

func main() {
	dsn := "https://user:password@sentry.io/1234"

	handler, err := sentry.New(dsn)
	if err != nil {
		panic(err)
	}
	defer handler.Close() // Make sure to close the handler to flush all error reporting in progress
}

Development

When all coding and testing is done, please run the test suite:

$ make check

Running integration tests

In order to run integration tests, a local development environment must be configured. Unfortunately it's a little bit more complicated than a "fire and forget" command, but most of it can be done in the CLI.

The first part is as easy as executing a series of commands:

cp docker-compose.override.yml.dist docker-compose.override.yml
cp .env.test.dist .env.test
docker-compose up -d
docker-compose run --rm sentry upgrade --noinput
docker-compose run --rm sentry createuser --email admin@example.com --password admin --superuser --no-input

Go to the Sentry dashboard:

open http://localhost:32622

Login with admin@example.com and admin credentials.

Complete the setup wizard and add a new test Go project.

Run the test suite:

source .env.test
make test

Cleanup the environment:

docker-compose down

License

The MIT License (MIT). Please see License File for more information.

You can’t perform that action at this time.