Repository navigation
feat(monitor): add direct API observability commands and profiles - #45
EASYGOING45 wants to merge 7 commits into
Conversation
|
@robot-wklken 你也 review 下 |
|
@EASYGOING45 基于最新拉取的 确认了三个需要修复的问题,均为【新】、中等严重程度(P2):
关键调用链证据:
已核对维护者此前的七条 inline 意见:MCP facade 接入方式仍然存在,实际链路是 验证:本次 建议: [from-codex local repo] |
|
@EASYGOING45 抽空看下review comments。 需要线下讨论可以单独找下我 |
|
收到,我这边Review处理一下哈 |
|
本次评审意见已在提交
本地验证结果:27 个 Go 测试包、151/151 集成场景通过;相关 race、覆盖率门禁、格式、lint、vet 和构建检查通过,并新增了上述问题的回归用例。 |
Cover default endpoint transport errors, missing release tags and missing asset URLs; restore the shared HTTP client after each test.
Add 65 reviewed read-only tools across 11 modules using shared context and auth. Include scoped permission guidance, component-based Profiles, readable time inputs and synthetic regression fixtures. Keep deployment data and credentials outside the repository.
Derive the native business array after Profile and flag resolution, reject conflicting input, and withhold malformed or out-of-scope alert lists before final output. Classify missing alerts separately from missing API routes and add unit, integration and usage coverage.
1fbe628 to
3f105b9
Compare
b08a868 to
45d7241
Compare
新增
bk-cli monitor <module> <tool_name>,通过现有 context 与用户凭据查询日志、指标、告警、APM/Trace 等观测数据。提供 11 个模块、65 个只读业务工具,每个命令直接请求对应的网关 HTTP API,复用公共请求执行和最终结果输出。实现与评审修复
--stage、重复--header和--jq契约;业务及中间请求均使用最终调用选项,不改变 active context。结果与 Profile 来源信息经过共享输出流程,投影失败不重发请求。permission_only,预检不执行 SQL。bk_biz_ids,本地拒绝冲突输入;归属不符或无法验证的告警列表不会进入最终输出。区分告警不存在、API 不存在、部分失败和服务端失败。state的响应:必须由服务端 Schema 明确声明业务权限,且唯一工具、Action、业务和授权结论一致。拒绝缺失、冲突或重复的授权响应,不从本地目录推断权限。relation_route_unavailable和response_too_large分类及处理提示;通用 503 不再被描述为权限拒绝。匹配上游错误仅用于选择固定错误码,不回显原始错误文本。list_result_tables,文档明确区分 BkBase 结果表与时序分组表;预检通过不代表查询或平台表归属校验成功。本地验证
以下结果对应提交
45d7241e5837c9788778c3849a9fa9ec89fb3a71的文件内容;使用干净源码副本和合成服务验证。go test ./... -count=1go test -raceMONITOR-014按场景 ID、精确文件路径独立运行make fmt、make lint、make build、git diff --check验证边界
本 PR 申请代码评审,不包含自动合并、部署或版本发布。
使用入口:Profile 初始化、monitor Skill。