mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 12:45:57 +08:00
fixed NaN response from Druid during span aggregates results
This commit is contained in:
parent
44304229cb
commit
584215b186
@ -254,19 +254,18 @@ func SearchSpansAggregate(client *godruid.Client, queryParams *model.SpanSearchA
|
||||
return nil, clientErr
|
||||
}
|
||||
|
||||
// fmt.Println("response", client.LastResponse)
|
||||
fmt.Println("response", client.LastResponse)
|
||||
|
||||
reveivedResponse := new([]SpanSearchAggregatesDuratonReceivedItem)
|
||||
|
||||
err = json.Unmarshal([]byte(client.LastResponse), reveivedResponse)
|
||||
if err != nil {
|
||||
receivedResponse := new([]SpanSearchAggregatesDuratonReceivedItem)
|
||||
err = json.Unmarshal([]byte(client.LastResponse), receivedResponse)
|
||||
if err != nil && len(*receivedResponse) == 0 {
|
||||
zap.S().Error(err)
|
||||
return nil, fmt.Errorf("Error in unmarshalling response from druid")
|
||||
}
|
||||
|
||||
var response []SpanSearchAggregatesResponseItem
|
||||
|
||||
for _, elem := range *reveivedResponse {
|
||||
for _, elem := range *receivedResponse {
|
||||
|
||||
value := elem.Result.Value
|
||||
timeObj, _ := time.Parse(time.RFC3339Nano, elem.Timestamp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user