mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 04:29:04 +08:00
chore: keep anomaly response sync with v4 query range (#6113)
This commit is contained in:
parent
76e7de3aed
commit
4356ddae8c
@ -106,12 +106,11 @@ func (aH *APIHandler) queryRangeV4(w http.ResponseWriter, r *http.Request) {
|
|||||||
RespondError(w, &model.ApiError{Typ: model.ErrorInternal, Err: err}, nil)
|
RespondError(w, &model.ApiError{Typ: model.ErrorInternal, Err: err}, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uniqueResults := make(map[string]*v3.Result)
|
resp := v3.QueryRangeResponse{
|
||||||
for _, anomaly := range anomalies.Results {
|
Result: anomalies.Results,
|
||||||
uniqueResults[anomaly.QueryName] = anomaly
|
ResultType: "anomaly",
|
||||||
uniqueResults[anomaly.QueryName].IsAnomaly = true
|
|
||||||
}
|
}
|
||||||
aH.Respond(w, uniqueResults)
|
aH.Respond(w, resp)
|
||||||
} else {
|
} else {
|
||||||
r.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
|
r.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
|
||||||
aH.QueryRangeV4(w, r)
|
aH.QueryRangeV4(w, r)
|
||||||
|
@ -1158,7 +1158,6 @@ type Result struct {
|
|||||||
AnomalyScores []*Series `json:"anomalyScores,omitempty"`
|
AnomalyScores []*Series `json:"anomalyScores,omitempty"`
|
||||||
List []*Row `json:"list,omitempty"`
|
List []*Row `json:"list,omitempty"`
|
||||||
Table *Table `json:"table,omitempty"`
|
Table *Table `json:"table,omitempty"`
|
||||||
IsAnomaly bool `json:"isAnomaly,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Series struct {
|
type Series struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user