You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][Tempo] Team pagination relies on metadata.total, which Tempo v4 doesn't return: only the first 50 teams are listed/collected #9306
I had searched in the issues and found no similar issues.
What happened
On a Tempo connection whose Tempo instance has more than 50 teams, only the first 50 teams can ever be reached:
Data scope picker (GET /plugins/tempo/connections/{id}/remote-scopes): the list shows the first 50 teams and never offers a next page, so team npm run commit has some issues? #51 onwards can't be selected by browsing (only by typing its name into search).
collect-teams subtask: collects only the first page (50 teams) on every run.
Both places in backend/plugins/tempo compute the page count from metadata.total:
api/remote.golistTempoRemoteTeams: if page.Offset+page.Limit < response.Metadata.Total { nextPage = ... }
but GET /4/teams doesn't return a total. Per the official OpenAPI spec (https://apidocs.tempo.io/tempo-openapi.yaml), the response is PageableTeam, whose metadata is PageableMetadata = count, limit, next, offset, previous. total therefore unmarshals as 0:
in listTempoRemoteTeams, offset + limit < 0 is never true → nextPage is always nil;
in CollectTeams, GetTotalPages returns 0 → the API collector fetches page 1 and stops.
This is the same root cause as the worklog pagination in #9163 (fixed by #9164 for worklogs only).
What do you expect to happen
All teams are listed in the data scope picker (following metadata.next), and collect-teams collects every page.
How to reproduce
Have a Tempo Cloud instance with more than 50 teams.
Create a Tempo connection and open "Add Data Scope" (or GET /plugins/tempo/connections/1/remote-scopes).
Only 50 teams are returned and nextPageToken is empty.
Run a blueprint with a Tempo team scope: SELECT url FROM _raw_tempo_api_teams shows a single request with offset=0, and _raw_tempo_api_teams has at most 50 rows.
Anything else
Proposed fix (I have a PR ready):
listTempoRemoteTeams: return a next page when metadata.next is set, instead of comparing against total.
Activity
fix(tempo): paginate teams with metadata.next instead of a missing to…