Skip to content

[Bug][Tempo] Team pagination relies on metadata.total, which Tempo v4 doesn't return: only the first 50 teams are listed/collected #9306

Closed

Description

@ShivamSharma43

Search before asking

  • 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.go listTempoRemoteTeams: if page.Offset+page.Limit < response.Metadata.Total { nextPage = ... }
  • tasks/team_collector.go GetTotalPages: (response.Metadata.Total + args.PageSize - 1) / args.PageSize

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

  1. Have a Tempo Cloud instance with more than 50 teams.
  2. Create a Tempo connection and open "Add Data Scope" (or GET /plugins/tempo/connections/1/remote-scopes).
  3. Only 50 teams are returned and nextPageToken is empty.
  4. 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):

Version

main

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added a commit that references this issue on Nov 3, 2026
    84e3707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions