Skip to content

Commit

Permalink
Rename some methods to be more consistent
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 committed Dec 14, 2023
1 parent b69e9ea commit d9b6af3
Show file tree
Hide file tree
Showing 10 changed files with 542 additions and 517 deletions.
2 changes: 1 addition & 1 deletion modules/frontend/frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestFrontendRoundTripsTagSearch(t *testing.T) {
},
SLO: testSLOcfg,
},
}, next, nil, nil, "", log.NewNopLogger(), nil)
}, next, nil, nil, nil, "", log.NewNopLogger(), nil)
require.NoError(t, err)

req := httptest.NewRequest("GET", "/", nil)
Expand Down
8 changes: 4 additions & 4 deletions modules/frontend/searchsharding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ type mockReader struct {
metas []*backend.BlockMeta
}

func (m *mockReader) SearchForTags(context.Context, *backend.BlockMeta, string, common.SearchOptions) (*tempopb.SearchTagsResponse, error) {
func (m *mockReader) SearchTags(context.Context, *backend.BlockMeta, string, common.SearchOptions) (*tempopb.SearchTagsResponse, error) {
return nil, nil
}

func (m *mockReader) SearchForTagValues(context.Context, *backend.BlockMeta, string, common.SearchOptions) ([]string, error) {
func (m *mockReader) SearchTagValues(context.Context, *backend.BlockMeta, string, common.SearchOptions) ([]string, error) {
return nil, nil
}

func (m *mockReader) SearchForTagsV2(context.Context, *backend.BlockMeta, []string, common.SearchOptions) (*tempopb.SearchTagsV2Response, error) {
func (m *mockReader) SearchTagsV2(context.Context, *backend.BlockMeta, []string, common.SearchOptions) (*tempopb.SearchTagsV2Response, error) {
return nil, nil
}

func (m *mockReader) SearchForTagValuesV2(context.Context, *backend.BlockMeta, *tempopb.SearchTagValuesRequest, common.SearchOptions) (*tempopb.SearchTagValuesV2Response, error) {
func (m *mockReader) SearchTagValuesV2(context.Context, *backend.BlockMeta, *tempopb.SearchTagValuesRequest, common.SearchOptions) (*tempopb.SearchTagValuesV2Response, error) {
return nil, nil
}

Expand Down
2 changes: 1 addition & 1 deletion modules/frontend/tagsharding_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (r *tagsSearchRequest) adjustRange(start, end uint32) tagSearchReq {
}

func (r *tagsSearchRequest) buildSearchTagRequest(subR *http.Request) (*http.Request, error) {
return api.BuildSearchTagRequest(subR, &r.request)
return api.BuildSearchTagsRequest(subR, &r.request)
}

func (r *tagsSearchRequest) buildTagSearchBlockRequest(subR *http.Request, blockID string,
Expand Down
2 changes: 1 addition & 1 deletion modules/frontend/tagsharding_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestTagsResultsHandler(t *testing.T) {
result2: "{ \"tagNames\":[\"tag2\",\"tag3\"]}",
expectedResult: "{\"tagNames\":[\"tag1\",\"tag2\",\"tag3\"]}",
expectedReq: func(r *http.Request) *http.Request {
expectedReq, _ := api.BuildSearchTagRequest(r, &tempopb.SearchTagsRequest{
expectedReq, _ := api.BuildSearchTagsRequest(r, &tempopb.SearchTagsRequest{
Scope: "all",
Start: start,
End: end,
Expand Down
8 changes: 4 additions & 4 deletions modules/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ func (q *Querier) internalTagSearchBlock(ctx context.Context, req *tempopb.Searc
opts.TotalPages = int(req.PagesToSearch)
opts.MaxBytes = q.limits.MaxBytesPerTrace(tenantID)

return q.store.SearchForTags(ctx, meta, req.SearchReq.Scope, opts)
return q.store.SearchTags(ctx, meta, req.SearchReq.Scope, opts)
}

func (q *Querier) internalTagSearchBlockV2(ctx context.Context, req *tempopb.SearchTagsBlockRequest) (*tempopb.SearchTagsV2Response, error) {
Expand All @@ -883,7 +883,7 @@ func (q *Querier) internalTagSearchBlockV2(ctx context.Context, req *tempopb.Sea
if req.SearchReq.Scope == "" {
// start with intrinsic scope and all traceql attribute scopes
atts := traceql.AllAttributeScopes()
scopes = make([]string, 0, len(atts)) // +1 for intrinsic
scopes = make([]string, 0, len(atts)+1) // +1 for intrinsic
scopes = append(scopes, api.ParamScopeIntrinsic)
for _, att := range atts {
scopes = append(scopes, att.String())
Expand Down Expand Up @@ -969,7 +969,7 @@ func (q *Querier) internalTagValuesSearchBlock(ctx context.Context, req *tempopb
opts.MaxBytes = q.limits.MaxBytesPerTrace(tenantID)

if !v2 {
tags, err := q.store.SearchForTagValues(ctx, meta, req.SearchReq.TagName, opts)
tags, err := q.store.SearchTagValues(ctx, meta, req.SearchReq.TagName, opts)
if err != nil {
return nil, err
}
Expand All @@ -979,7 +979,7 @@ func (q *Querier) internalTagValuesSearchBlock(ctx context.Context, req *tempopb
},
}, nil
}
resp, err := q.store.SearchForTagValuesV2(ctx, meta, req.SearchReq, opts)
resp, err := q.store.SearchTagValuesV2(ctx, meta, req.SearchReq, opts)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit d9b6af3

Please sign in to comment.