Merge pull request #796 from SigNoz/feat/support-custom-events

feat(backend): support custom events in span
This commit is contained in:
Ankit Nayan 2022-03-03 18:23:44 +05:30 committed by GitHub
commit 25559c8781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,17 +205,8 @@ func (item *SearchSpanReponseItem) GetValues() []interface{} {
for _, item := range references {
referencesStringArray = append(referencesStringArray, item.toString())
}
var errorEvent map[string]interface{}
for _, e := range item.Events {
json.Unmarshal([]byte(e), &errorEvent)
if errorEvent["name"] == "exception" {
break
} else {
errorEvent = nil
}
}
returnArray := []interface{}{int64(timeObj.UnixNano() / 1000000), item.SpanID, item.TraceID, item.ServiceName, item.Name, strconv.Itoa(int(item.Kind)), strconv.FormatInt(item.DurationNano, 10), item.TagsKeys, item.TagsValues, referencesStringArray, errorEvent, item.HasError}
returnArray := []interface{}{int64(timeObj.UnixNano() / 1000000), item.SpanID, item.TraceID, item.ServiceName, item.Name, strconv.Itoa(int(item.Kind)), strconv.FormatInt(item.DurationNano, 10), item.TagsKeys, item.TagsValues, referencesStringArray, item.Events, item.HasError}
return returnArray
}