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: update how limit is added to table queries (#3207)

Nityananda Gohain7b85ece7960f
diff --git a/pkg/query-service/app/logs/v3/query_builder.go b/pkg/query-service/app/logs/v3/query_builder.go
index 7047273497..1b84f71fcc 100644
--- a/pkg/query-service/app/logs/v3/query_builder.go
+++ b/pkg/query-service/app/logs/v3/query_builder.go
@@ -442,7 +442,7 @@ func PrepareLogsQuery(start, end int64, queryType v3.QueryType, panelType v3.Pan
query, err = reduceQuery(query, mq.ReduceTo, mq.AggregateOperator)
}
- if panelType == v3.PanelTypeList || panelType == v3.PanelTypeTable {
+ if panelType == v3.PanelTypeList {
if mq.PageSize > 0 {
if mq.Limit > 0 && mq.Offset > mq.Limit {
return "", fmt.Errorf("max limit exceeded")
@@ -452,8 +452,9 @@ func PrepareLogsQuery(start, end int64, queryType v3.QueryType, panelType v3.Pan
} else {
query = addLimitToQuery(query, mq.Limit)
}
+ } else if panelType == v3.PanelTypeTable {
+ query = addLimitToQuery(query, mq.Limit)
}
return query, err
-
}