cmd/stcrashreceiver: Add tag for report type (crash/failure) (#7374)

This commit is contained in:
Simon Frei 2021-02-18 14:16:32 +01:00 committed by GitHub
parent 342ade501a
commit 0970aed596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -84,7 +84,7 @@ func handleFailureFn(dsn string) func(w http.ResponseWriter, req *http.Request)
return
}
for _, r := range reports {
pkt := packet(version)
pkt := packet(version, "failure")
pkt.Message = r.Description
pkt.Extra = raven.Extra{
"count": r.Count,

View File

@ -122,7 +122,7 @@ func parseCrashReport(path string, report []byte) (*raven.Packet, error) {
}
}
pkt := packet(version)
pkt := packet(version, "crash")
pkt.Message = string(subjectLine)
pkt.Extra = raven.Extra{
"url": reportServer + path,
@ -229,7 +229,7 @@ func parseVersion(line string) (version, error) {
return v, nil
}
func packet(version version) *raven.Packet {
func packet(version version, reportType string) *raven.Packet {
pkt := &raven.Packet{
Platform: "go",
Release: version.tag,
@ -242,6 +242,7 @@ func packet(version version) *raven.Packet {
raven.Tag{Key: "goos", Value: version.goos},
raven.Tag{Key: "goarch", Value: version.goarch},
raven.Tag{Key: "builder", Value: version.builder},
raven.Tag{Key: "report_type", Value: reportType},
},
}
if version.commit != "" {