1
0

GODT-1375: Add host architecture to sentry reports

This commit is contained in:
Jakub
2022-01-14 10:10:18 +01:00
committed by Jakub Cuth
parent fc69b9aabb
commit f9f4ce996d
5 changed files with 110 additions and 2 deletions

View File

@ -31,7 +31,7 @@ import (
var skippedFunctions = []string{} //nolint[gochecknoglobals]
func init() { // nolint[noinit]
func init() { //nolint[noinit, gochecknoinits]
if err := sentry.Init(sentry.ClientOptions{
Dsn: constants.DSNSentry,
Release: constants.Revision,
@ -49,6 +49,7 @@ type Reporter struct {
appName string
appVersion string
userAgent fmt.Stringer
hostArch string
}
// NewReporter creates new sentry reporter with appName and appVersion to report.
@ -57,6 +58,7 @@ func NewReporter(appName, appVersion string, userAgent fmt.Stringer) *Reporter {
appName: appName,
appVersion: appVersion,
userAgent: userAgent,
hostArch: getHostAarch(),
}
}
@ -110,6 +112,7 @@ func (r *Reporter) scopedReport(context map[string]interface{}, doReport func())
"Version": r.appVersion,
"UserAgent": r.userAgent.String(),
"UserID": "",
"HostArch": r.hostArch,
}
sentry.WithScope(func(scope *sentry.Scope) {