fix: typo

change: do not add console output by default

feat: add GA for docs

refactor: move builtin to internal

refactor: relocate sentry sdk

feat: report events with ga

change: use http client session

fix: report GA events

change: sentry
This commit is contained in:
debugtalk
2021-11-22 16:23:47 +08:00
parent ae7710e9d0
commit 7fd26395ed
30 changed files with 286 additions and 42 deletions

27
internal/sentry/init.go Normal file
View File

@@ -0,0 +1,27 @@
package sentry
import (
"time"
"github.com/getsentry/sentry-go"
"github.com/httprunner/hrp/internal/version"
)
func init() {
// init sentry sdk
err := sentry.Init(sentry.ClientOptions{
Dsn: "https://cff5efc69b1a4325a4cf873f1e70c13a@o334324.ingest.sentry.io/6070292",
Release: version.VERSION,
})
if err != nil {
panic("init sentry sdk failed!")
}
sentry.ConfigureScope(func(scope *sentry.Scope) {
scope.SetLevel(sentry.LevelError)
})
}
func Flush() {
sentry.Flush(3 * time.Second)
}