Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/treblle/treblle-go-gin

The official Treblle SDK for Go, tailored for the Gin framework. Seamlessly integrate Treblle into your Gin applications to effortlessly manage communication with your dashboard, transmit errors, and safeguard sensitive data.
https://github.com/treblle/treblle-go-gin

api api-monitoring api-observability backend developer-tool gin gin-framework go golang-sdk logging rest-api restful-api sdk treblle treblle-sdk

Last synced: 2 months ago
JSON representation

The official Treblle SDK for Go, tailored for the Gin framework. Seamlessly integrate Treblle into your Gin applications to effortlessly manage communication with your dashboard, transmit errors, and safeguard sensitive data.

Awesome Lists containing this project

README

        

# treblle-go-gin
The offical Treblle SDK for Go using Gin

## Installation

```shell
go get github.com/treblle/treblle-go-gin
```

Trebble uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.

## Basic configuration

Configure Treblle at the start of your `main()` function:

```go
import "github.com/treblle/treblle-go"

func main() {
treblle.Configure(treblle.Configuration{
APIKey: "YOUR API KEY HERE",
ProjectID: "YOUR PROJECT ID HERE",
KeysToMask: []string{"password", "card_number"}, // optional, mask fields you don't want sent to Treblle
ServerURL: "https://rocknrolla.treblle.com", // optional, don't use default server URL
}

// rest of your program.
}

```

After that, just use the middleware with any of your Gin handlers:
```go
r := gin.Default()
r.Use(treblle.GinMiddleware())
```