Skip to content
Error handler integration for StackDriver
Makefile Go
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
.idea
.editorconfig
.gitignore
.golangci.yml
CHANGELOG.md
LICENSE
Makefile
README.md
example_test.go
go.mod
go.sum
handler.go
handler_test.go

README.md

Stackdriver error handler

CircleCI Go Report Card GolangCI GoDoc

Error handler integration for Stackdriver

Installation

go get emperror.dev/handler/stackdriver

Usage

package main

import (
	"context"
	
	"cloud.google.com/go/errorreporting"
	"emperror.dev/handler/stackdriver"
	"golang.org/x/oauth2/google"
	"google.golang.org/api/option"
)

func main() {
	// Create the client
	ctx := context.Background()
	client, err := errorreporting.NewClient(
		ctx,
		"my-gcp-project",
		errorreporting.Config{
			ServiceName:    "myservice",
			ServiceVersion: "v1.0",
		},
		option.WithCredentialsFile("path/to/google_credentials.json"),
	)
	if err != nil {
		// TODO: handle error
	}
	defer client.Close()

	// Create the handler
	_ = stackdriver.New(client)
}

Development

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

$ make check

License

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

You can’t perform that action at this time.