按平台安装
Go
安装 go get github.com/blipit-io/blipit-go
添加 blipit-go 模块,并在 main 中用项目的公钥和项目 id 调用一次 Init。进程退出前调用 Flush,以免丢失最后的事件。
1安装
go get github.com/blipit-io/blipit-go2在 main 中初始化
import (
"log"
"time"
"github.com/blipit-io/blipit-go"
)
func main() {
if err := blipit.Init(blipit.Options{
Key: "<public key>",
Project: "<project id>",
Environment: "production",
Release: "myapp@1.4.2",
}); err != nil {
log.Fatal(err)
}
defer blipit.Flush(2 * time.Second)
}3手动捕获和登录尝试
blipit.CaptureException(err)
blipit.CaptureMessage("cache miss rate above 50%")
blipit.SetUser(blipit.User{ID: "42", Email: "ana@example.com"})
blipit.CaptureSecurity(blipit.Security{Kind: "login_failed", Actor: email, IP: ip, UserAgent: agent, Outcome: "bad_password"})4验证是否生效
打开 app.blipit.io 中的“问题”。首个事件几秒钟内就会出现,并归组为一个问题,负责人会收到邮件。
blipit.CaptureMessage("Hello from Go")须知
- 在 Options 中设置 TracesSampleRate: 0.2,请求就会发送到性能页面。
- 已经在用 sentry-go?无需更改即可使用 DSN https://<public key>@in.blipit.io/<project id>。
遇到问题?发邮件至 support@blipit.io。每个项目的密钥和确切的 DSN 在 app.blipit.io 的“API 密钥”下。

