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: remove isRoot and Entrypoint from selectfields (#8893)

Nityananda Gohain5bb6d78c42ac
diff --git a/pkg/types/querybuildertypes/querybuildertypesv5/validation.go b/pkg/types/querybuildertypes/querybuildertypesv5/validation.go
index cc90b6ae20..5e5b3eea2a 100644
--- a/pkg/types/querybuildertypes/querybuildertypesv5/validation.go
+++ b/pkg/types/querybuildertypes/querybuildertypesv5/validation.go
@@ -145,6 +145,25 @@ func (q *QueryBuilderQuery[T]) Validate(requestType RequestType) error {
}
}
+ if requestType == RequestTypeRaw {
+ if err := q.validateSelectFields(); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func (q *QueryBuilderQuery[T]) validateSelectFields() error {
+ // isRoot and isEntryPoint are returned by the Metadata API, so if someone sends them, we have to reject the request.
+ for _, v := range q.SelectFields {
+ if v.Name == "isRoot" || v.Name == "isEntryPoint" {
+ return errors.NewInvalidInputf(
+ errors.CodeInvalidInput,
+ "isRoot and isEntryPoint fields are not supported in selectFields",
+ )
+ }
+ }
return nil
}