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.

fix: throw error when response for value panel returns more than one series (#4332)

Srikanth Chekuri92717774a281
diff --git a/pkg/query-service/app/querier/querier.go b/pkg/query-service/app/querier/querier.go
index 395659ced2..16ef778d20 100644
--- a/pkg/query-service/app/querier/querier.go
+++ b/pkg/query-service/app/querier/querier.go
@@ -507,6 +507,16 @@ func (q *querier) QueryRange(ctx context.Context, params *v3.QueryRangeParamsV3,
err = fmt.Errorf("invalid query type")
}
}
+
+ // return error if the number of series is more than one for value type panel
+ if params.CompositeQuery.PanelType == v3.PanelTypeValue {
+ if len(results) > 1 {
+ err = fmt.Errorf("there can be only one active query for value type panel")
+ } else if len(results) == 1 && len(results[0].Series) > 1 {
+ err = fmt.Errorf("there can be only one result series for value type panel but got %d", len(results[0].Series))
+ }
+ }
+
return results, err, errQueriesByName
}