You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jaeger UI 1.5.x版本Service Dependency Tab功能异常求助

解决方案:Jaeger UI 1.5.x Service Dependency Tab 报错问题

问题根源

  • REST Error:UI代码中定义了export const ANALYTICS_ROOT = prefixUrl('/analytics/');,fetchDeepDependencyGraph(query)方法会调用${ANALYTICS_ROOT}v1/dependencies接口,但Go后端未实现该REST接口。
  • Invalid Json错误:选择服务后触发的请求因接口缺失,后端返回非JSON格式内容(如404错误页),被UI当成JSON解析导致报错。

具体解决步骤

1. 后端补全接口实现(推荐方案)

若需保留Service Dependency功能,在Go后端中实现/analytics/v1/dependencies接口:

  • 接口需支持接收时间范围、服务名称等查询参数
  • 返回符合UI预期的依赖图JSON结构,示例如下:
    {
      "data": [
        {
          "source": "user-service",
          "target": "order-service",
          "callCount": 256
        },
        {
          "source": "order-service",
          "target": "payment-service",
          "callCount": 189
        }
      ]
    }
    

2. 临时禁用Service Dependency Tab

如果暂时不需要该功能,可通过以下方式关闭:

  • 在Jaeger UI配置文件中找到功能开关,禁用Service Dependency模块
  • 或修改UI代码,注释掉fetchDeepDependencyGraph的调用逻辑及Service Dependency Tab的入口代码

3. 修复Invalid Json错误

  • 确保后端所有接口返回合法JSON,当接口未实现时,返回标准JSON格式的错误响应(如{"code": 404, "msg": "接口未实现"}),避免返回HTML错误页
  • 在UI端增加响应格式校验逻辑,先判断响应是否为合法JSON,再进行解析处理

内容的提问来源于stack exchange,提问作者Durrab Khan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 14:32:07