Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: keep anomaly response sync with v4 query range (#6113)

Srikanth Chekuri4356ddae8c67
diff --git a/ee/query-service/app/api/queryrange.go b/ee/query-service/app/api/queryrange.go
index d4f3eb975a..f5ad490ed5 100644
--- a/ee/query-service/app/api/queryrange.go
+++ b/ee/query-service/app/api/queryrange.go
@@ -106,12 +106,11 @@ func (aH *APIHandler) queryRangeV4(w http.ResponseWriter, r *http.Request) {
RespondError(w, &model.ApiError{Typ: model.ErrorInternal, Err: err}, nil)
return
}
- uniqueResults := make(map[string]*v3.Result)
- for _, anomaly := range anomalies.Results {
- uniqueResults[anomaly.QueryName] = anomaly
- uniqueResults[anomaly.QueryName].IsAnomaly = true
+ resp := v3.QueryRangeResponse{
+ Result: anomalies.Results,
+ ResultType: "anomaly",
}
- aH.Respond(w, uniqueResults)
+ aH.Respond(w, resp)
} else {
r.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
aH.QueryRangeV4(w, r)
diff --git a/pkg/query-service/model/v3/v3.go b/pkg/query-service/model/v3/v3.go
index 2d99118533..9770df4108 100644
--- a/pkg/query-service/model/v3/v3.go
+++ b/pkg/query-service/model/v3/v3.go
@@ -1158,7 +1158,6 @@ type Result struct {
AnomalyScores []*Series `json:"anomalyScores,omitempty"`
List []*Row `json:"list,omitempty"`
Table *Table `json:"table,omitempty"`
- IsAnomaly bool `json:"isAnomaly,omitempty"`
}
type Series struct {