https://github.com/emperror/handler-stackdriver
Error handler integration for StackDriver
https://github.com/emperror/handler-stackdriver
error-handler stackdriver
Last synced: 20 days ago
JSON representation
Error handler integration for StackDriver
- Host: GitHub
- URL: https://github.com/emperror/handler-stackdriver
- Owner: emperror
- License: mit
- Created: 2019-07-29T10:56:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-28T21:11:56.000Z (almost 6 years ago)
- Last Synced: 2025-11-08T18:02:20.482Z (5 months ago)
- Topics: error-handler, stackdriver
- Language: Makefile
- Homepage: https://emperror.dev/handler/stackdriver
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Stackdriver error handler
[](https://github.com/emperror/handler-stackdriver/actions?query=workflow%3ACI)
[](https://codecov.io/gh/emperror/handler-stackdriver)
[](https://goreportcard.com/report/emperror.dev/handler/stackdriver)

[](https://pkg.go.dev/mod/emperror.dev/handler/stackdriver)
**Error handler integration for [Stackdriver](https://cloud.google.com/stackdriver/)**
## Installation
```bash
go get emperror.dev/handler/stackdriver
```
## Usage
```go
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:
```bash
$ make check
```
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.