mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 03:55:57 +08:00
feat(backend): support custom events in span
This commit is contained in:
parent
938f42bd4f
commit
bdeadaeff6
@ -205,17 +205,8 @@ func (item *SearchSpanReponseItem) GetValues() []interface{} {
|
|||||||
for _, item := range references {
|
for _, item := range references {
|
||||||
referencesStringArray = append(referencesStringArray, item.toString())
|
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
|
return returnArray
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user