[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 个 reaction 已指派 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 小时
30 天内合并 PR
78

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/devlake 的其他 Issue

查看 apache/devlake 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。