Skip to content

Commit

Permalink
Remove limit from tags endpoint parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 committed Nov 24, 2023
1 parent f38cd98 commit c68de6f
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 146 deletions.
5 changes: 1 addition & 4 deletions modules/frontend/tagsharding.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ func (s searchTagSharder) RoundTrip(r *http.Request) (*http.Response, error) {
}, nil
}

// adjust limit based on config
searchReq.Limit = adjustLimit(searchReq.Limit, s.cfg.DefaultLimit, s.cfg.MaxLimit)

requestCtx := r.Context()
tenantID, err := user.ExtractOrgID(requestCtx)
if err != nil {
Expand Down Expand Up @@ -79,7 +76,7 @@ func (s searchTagSharder) RoundTrip(r *http.Request) (*http.Response, error) {

// execute requests
wg := boundedwaitgroup.New(uint(s.cfg.ConcurrentRequests))
taghandler := s.tagShardHandlerFactory(ctx, int(searchReq.Limit))
taghandler := s.tagShardHandlerFactory(ctx, 0)

progress := taghandler.progress()
for req := range reqCh {
Expand Down
40 changes: 0 additions & 40 deletions pkg/api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,46 +705,6 @@ func BuildSearchTagRequest(req *http.Request, searchReq *tempopb.SearchTagsReque
q := req.URL.Query()
q.Set(urlParamStart, strconv.FormatUint(uint64(searchReq.Start), 10))
q.Set(urlParamEnd, strconv.FormatUint(uint64(searchReq.End), 10))
if searchReq.Limit != 0 {
q.Set(urlParamLimit, strconv.FormatUint(uint64(searchReq.Limit), 10))
}

req.URL.RawQuery = q.Encode()

return req, nil
}

func BuildTagSearchBlockRequest(req *http.Request, searchReq *tempopb.SearchTagsBlockRequest) (*http.Request, error) {
if req == nil {
req = &http.Request{
URL: &url.URL{},
}
}

req, err := BuildSearchTagRequest(req, searchReq.SearchReq)
if err != nil {
return nil, err
}

q := req.URL.Query()
q.Set(urlParamSize, strconv.FormatUint(searchReq.Size_, 10))
q.Set(urlParamBlockID, searchReq.BlockID)
q.Set(urlParamStartPage, strconv.FormatUint(uint64(searchReq.StartPage), 10))
q.Set(urlParamPagesToSearch, strconv.FormatUint(uint64(searchReq.PagesToSearch), 10))
q.Set(urlParamEncoding, searchReq.Encoding)
q.Set(urlParamIndexPageSize, strconv.FormatUint(uint64(searchReq.IndexPageSize), 10))
q.Set(urlParamTotalRecords, strconv.FormatUint(uint64(searchReq.TotalRecords), 10))
q.Set(urlParamDataEncoding, searchReq.DataEncoding)
q.Set(urlParamVersion, searchReq.Version)
q.Set(urlParamFooterSize, strconv.FormatUint(uint64(searchReq.FooterSize), 10))
if len(searchReq.DedicatedColumns) > 0 {
columnsJSON, err := json.Marshal(searchReq.DedicatedColumns)
if err != nil {
return nil, err
}
q.Set(urlParamDedicatedColumns, string(columnsJSON))
}

req.URL.RawQuery = q.Encode()

return req, nil
Expand Down
166 changes: 65 additions & 101 deletions pkg/tempopb/tempo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pkg/tempopb/tempo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ message SearchMetrics {

message SearchTagsRequest {
string scope = 1;
uint32 Limit = 2;
uint32 start = 3;
uint32 end = 4;
}
Expand Down

0 comments on commit c68de6f

Please sign in to comment.