已合并
[bugfix] 修复 mooncake KV store metrics 获取失败:metrics 端口统一为 50090 #874
[bugfix] 修复 mooncake KV store metrics 获取失败:metrics 端口统一为 50090 #874
已合并
zhinengwu创建于 13 天前
zhinengwu
zhinengwu
13 天前

1. 合入背景

mooncake KV store 的 Prometheus metrics 抓取链路失效:coordinator 自动默认对 mooncake 取业务端口 50088(该端口无 /metrics),store 侧未显式传 --metrics_port(落在上游默认 9003),deployer 全局默认 50088 —— 三处端口约定不一致,导致 kv_store_* 指标获取失败。

关联 ISSUE:#510

2. 修改内容

  1. motor/coordinator/metrics/metrics_collector.py:mooncake 后端自动抓取端口默认 50088 → 50090(与 memcache 统一);
  2. examples/deployer/startup/roles/kv_store_backends/mooncake/mooncake.sh:mooncake_master 增加 --metrics_port "${MOONCAKE_METRICS_PORT:-50090}";
  3. examples/deployer/startup/roles/all_combine_in_single_container.sh:单容器模式同样增加 --metrics_port;
  4. examples/deployer/lib/generator/kv_cache_store.py:g_mmc_metrics_port 死代码默认统一为 DEFAULT_MMC_METRICS_PORT(50090);
  5. tests/coordinator/core/test_metrics.py:新增回归测试 test_fetch_mooncake_metrics_auto_port_default_50090;
  6. .agents/skills/motor-dev/references/metrics.md:同步 KV store metrics 抓取端口约定。

3. 资料变更

不涉及(仅同步 motor-dev skill 参考文档)。

4. 接口变更

不涉及。metrics 端口默认值调整属内部约定,kv_cache_store_config.metrics_port / KV_STORE_METRICS_PORT 显式配置路径不变且优先级高于默认值。

5. 测试结果

image.png

6. CheckList

likedislike
Pull Request已成功合入, 合并人@wangyang
(感谢 zhinengwu 的贡献)
zhinengwuzhinengwu
13 天前 关联了issue:[Bug-Report|缺陷反馈]: kv_cache_store 支持 mooncake metrics 配置
atomgit-bot
atomgit-bot
13 天前 评论:

变更摘要

本 PR 为 bugfix,修复 mooncake KV store 的 Prometheus metrics 抓取链路失效问题。根因是三处端口约定不一致:coordinator 默认对 mooncake 取业务端口 50088(该端口无 /metrics)、store 侧未显式传 --metrics_port(落入上游默认 9003)、deployer 全局默认 50088,导致 kv_store_* 指标获取失败。本次将 mooncake metrics 抓取端口统一为 50090(与 memcache 一致):MetricsCollector 自动回退端口由 50088 改为 50090,deployer 的 mooncake 启动脚本(含单容器模式)为 mooncake_master 显式增加 --metrics_port "${MOONCAKE_METRICS_PORT:-50090}",kv_cache_store.pyg_mmc_metrics_port 的默认值死代码统一为 DEFAULT_MMC_METRICS_PORT,并新增回归测试。kv_cache_store_config.metrics_port / KV_STORE_METRICS_PORT 显式配置路径不变且优先级高于默认值,不涉及接口变更。

主要改动

  • metrics_collector.py 默认端口回退统一:MetricsCollector 中 mooncake 后端未显式配置 metrics 端口时的自动回退值由 "50088" 改为 "50090",与 memcache 一致,修复 mooncake 业务端口无 /metrics 导致抓取失败的问题。
  • mooncake 启动脚本显式指定 metrics 端口:mooncake.shall_combine_in_single_container.shmooncake_master 启动命令均增加 --metrics_port "${MOONCAKE_METRICS_PORT:-50090}",使 store 侧不再落入上游默认端口(9003)。
  • kv_cache_store.py 默认值死代码统一:normalize_kv_cache_store_configg_mmc_metrics_port 的默认值回退逻辑简化为统一使用 DEFAULT_MMC_METRICS_PORT,删除按后端(mooncake 走 DEFAULT_KV_CACHE_STORE_PORT 50088)分支判断的死代码。
  • 新增回归测试:tests/coordinator/core/test_metrics.py 新增 test_fetch_mooncake_metrics_auto_port_default_50090,验证 mooncake 后端未显式指定 metrics 端口时抓取地址回退为 http://kv-store-svc:50090/metrics(该测试在旧代码 50088 下失败、新代码下通过)。
  • 同步参考文档:.agents/skills/motor-dev/references/metrics.md 同步 KV store metrics 抓取端口约定(未附补丁,仅文档同步)。
likedislike
不准确?
atomgit-bot
atomgit-bot
13 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
ascend-robotascend-robot成员
13 天前 添加了label:stat/needs-squash
ascend-robotascend-robot成员
13 天前 添加了label:ascend-cla/yes
AtlasAccountAtlasAccount成员
13 天前 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
13 天前 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-Ascend/MindIE-Motor 王洋, 王君 (2/2) 王洋 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

qq_46749096, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
ascend-robot
ascend-robot成员
13 天前 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
13 天前 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
13 天前 评论:

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robotascend-robot成员
13 天前 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
13 天前 添加了label:docs-ci-pipeline-success
AtlasAccountAtlasAccount成员
13 天前 删除了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
13 天前 添加了label:ci-pipeline-passed
AtlasAccount
AtlasAccount成员
13 天前 评论:
流水线 PR-pipeline_MindIE-Motor_gitcode#3365 [ commitID:5553caf7 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_linux_arm ✅ COMPLETED >>>
恶意代码检查 Antipoison ✅ COMPLETED >>>
编码安全与规范检查 pre-commit ✅ COMPLETED >>>
开源片段检查 SCA ✅ COMPLETED >>>
开发者测试 UT_linux_arm ✅ COMPLETED >>>
流水线 PR-pipeline_MindIE-Motor_gitcode ✅ COMPLETED >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
zhinengwuzhinengwu
12 天前 修改了pull request 的描述
zhinengwuzhinengwu
11 天前 推送  10 个提交:a56ccb58-9 commits from branch masterb479eef6-Merge branch 'master' of https://gitcode.com/Ascend/MindIE-PyMotor into mooncake_standalone
AtlasAccountAtlasAccount成员
11 天前 删除了label:ci-pipeline-passed
ascend-robotascend-robot成员
11 天前 删除了label:ascend-cla/yes
ascend-robotascend-robot成员
11 天前 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
11 天前 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
11 天前 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
11 天前 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
11 天前 评论:

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robotascend-robot成员
11 天前 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
11 天前 添加了label:docs-ci-pipeline-success
wangyang
wangyang成员
11 天前 评论:

/lgtm
/approve

likedislike
ascend-robotascend-robot成员
11 天前 添加了label:approved
zhinengwu
zhinengwu
11 天前 评论:

compile

likedislike
AtlasAccountAtlasAccount成员
11 天前 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
11 天前 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
11 天前 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
11 天前 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
11 天前 评论:

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robotascend-robot成员
11 天前 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
11 天前 添加了label:docs-ci-pipeline-success
AtlasAccountAtlasAccount成员
11 天前 删除了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
11 天前 添加了label:ci-pipeline-passed
AtlasAccount
AtlasAccount成员
11 天前 评论:
流水线 PR-pipeline_MindIE-Motor_gitcode#3409 [ commitID:b479eef6 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_linux_arm ✅ COMPLETED >>>
恶意代码检查 Antipoison ✅ COMPLETED >>>
编码安全与规范检查 pre-commit ✅ COMPLETED >>>
开源片段检查 SCA ✅ COMPLETED >>>
开发者测试 UT_linux_arm ✅ COMPLETED >>>
流水线 PR-pipeline_MindIE-Motor_gitcode ✅ COMPLETED >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
tobking
tobking成员
11 天前 评论:

/lgtm

likedislike
ascend-robotascend-robot成员
11 天前 添加了label:lgtm
zhinengwuzhinengwu
11 天前 修改了pull request 的描述
wangyangwangyang成员
11 天前 合入了pull request