[Bug][Tempo] GET /connections/{id}/teams always fails to decode the teams page, and remote scope search only sees the first 50 teams

オープン
#9,320 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@ShivamSharma43 がすでに取り組んでいます。

2026年11月3日 から。

  • #9321 @ShivamSharma43 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

Start with backend/plugins/tempo/api/connection.go (GetTeams) and api/remote.go (searchTempoRemoteTeams); compare their requests with listTempoRemoteTeams and the collectors, which already follow metadata.next. Add coverage using a fake API client for multiple response pages. Done means GetTeams returns every team and remote scope search considers all matching teams; linked PR #9321 is already open.

索引モデルが issue の本文から書いたものです。

説明

Search before asking
  • I had searched in the issues and found no similar issues.
What happened

GET /plugins/tempo/connections/{connectionId}/teams (GetTeams in backend/plugins/tempo/api/connection.go) always fails with failed to unmarshal teams response.

It decodes the GET /4/teams response into []models.TempoTeamResponse, but Tempo v4 returns a page object (PageableTeam: self, metadata, results), not an array. On main (84e3707), decoding such a body with api.UnmarshalResponse into []models.TempoTeamResponse fails with error decoding response from https://api.tempo.io/4/teams: raw response: {"self":...,"metadata":{...},"results":[...]}. Even if it decoded, it would only return the first page (Tempo's default limit is 50).

The remote scope search (searchTempoRemoteTeams in api/remote.go, behind search-remote-scopes) has the same single-request issue. It sends one GET /4/teams?name=... without offset/limit, so it only looks at the first 50 teams the API returns. Its own page/pageSize paging then works on that list, so if more than 50 teams match, the later ones can't be found.

What do you expect to happen

GET /plugins/tempo/connections/{id}/teams returns every team of the Tempo instance, and the remote scope search looks at every matching team. Both should follow metadata.next like listTempoRemoteTeams and the collectors do since #9307.

How to reproduce
  1. Create a Tempo connection.
  2. curl http://localhost:8080/plugins/tempo/connections/1/teams: the request fails with failed to unmarshal teams response.
Anything else

Proposed fix (I have a PR ready): add a listAllTempoTeams helper in api/remote.go that pages through GET /4/teams with offset/limit until metadata.next is absent. Use it in GetTeams and in searchTempoRemoteTeams, and add unit tests with a fake API client.

Version

main

Are you willing to submit PR?
  • Yes I am willing to submit a PR!
Code of Conduct
主要言語
Go
スター
3.2k
フォーク
832
平均マージ
1日 21時間
マージ済み PR(30日)
78

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/devlake のほかの issue

apache/devlake の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。