Skip to content

Commit 751802f

Browse files
committed
fix: limit keys for empty search key
1 parent bd02848 commit 751802f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/telemetrymetadata/metadata.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ func (t *telemetryMetaStore) getTracesKeys(ctx context.Context, fieldKeySelector
179179

180180
conds = append(conds, sb.And(fieldKeyConds...))
181181
limit += fieldKeySelector.Limit
182+
if strings.TrimSpace(fieldKeySelector.Name) == "" {
183+
sb.Limit(200)
184+
}
182185
}
183186
sb.Where(sb.Or(conds...))
184187
sb.GroupBy("tag_key", "tag_type", "tag_data_type")
@@ -387,6 +390,9 @@ func (t *telemetryMetaStore) getLogsKeys(ctx context.Context, fieldKeySelectors
387390

388391
conds = append(conds, sb.And(fieldKeyConds...))
389392
limit += fieldKeySelector.Limit
393+
if strings.TrimSpace(fieldKeySelector.Name) == "" {
394+
sb.Limit(200)
395+
}
390396
}
391397
sb.Where(sb.Or(conds...))
392398
sb.GroupBy("tag_key", "tag_type", "tag_data_type")

0 commit comments

Comments
 (0)