Skip to content

Commit

Permalink
fix: group by with filters
Browse files Browse the repository at this point in the history
  • Loading branch information
nityanandagohain committed Nov 8, 2024
1 parent 0418bff commit bb6f027
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/query-service/app/traces/v4/query_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,16 @@ func buildTracesQuery(start, end, step int64, mq *v3.BuilderQuery, panelType v3.
if err != nil {
return "", err
}
if filterSubQuery != "" {
filterSubQuery = " AND " + filterSubQuery
}

emptyValuesInGroupByFilter, err := handleEmptyValuesInGroupBy(mq.GroupBy)
if err != nil {
return "", err
}
filterSubQuery += emptyValuesInGroupByFilter

if filterSubQuery != "" {
filterSubQuery = " AND " + filterSubQuery
if emptyValuesInGroupByFilter != "" {
filterSubQuery = " AND " + emptyValuesInGroupByFilter
}

resourceSubQuery, err := resource.BuildResourceSubQuery("signoz_traces", "distributed_traces_v3_resource", bucketStart, bucketEnd, mq.Filters, mq.GroupBy, mq.AggregateAttribute, false)
Expand Down

0 comments on commit bb6f027

Please sign in to comment.