Skip to content

feat(cli): configure and test Tencent Cloud CLS tracing - #3187

Merged
Bosheng0422 merged 1 commit into
developfrom
feature/cls-cli
Nov 27, 2026
Merged

Bosheng0422 merged 1 commit into
developfrom
feature/cls-cli

Conversation

@Bosheng0422

Copy link
Copy Markdown
Collaborator

Summary

为腾讯云 CLS(AgentObs)新增 octop cls configure、show 和 test。CLI 通过运行中 Octop 服务的管理 API 保存配置,使用具有 observability 权限的账户。保存后立即启用 CLS 上报,已启用 Langfuse 的实例将切换到 CLS。

配置方式 命令示例 行为
新建应用 octop cls configure --new --region ap-guangzhou --app-name octop-prod 创建 AgentObs 应用并绑定返回的 Trace Topic。同一地域已有同名、同接入类型的应用时直接复用。
绑定已有 Topic octop cls configure --existing --region ap-guangzhou --topic-id YOUR_TRACE_TOPIC_ID 直接绑定指定 Trace Topic,支持仅有上报权限的凭证。

运行 octop cls configure 可进入交互向导,也可从已有应用列表中选择。octop cls show 显示当前后端、配置来源和脱敏后的设置。octop --json cls test 分别报告管理 API 和 OTLP 上报端点的探测结果,失败时返回非零退出码。查看和测试均支持由服务端环境变量启用的 CLS,包括 STS 凭证。

Target branch

  • develop

Type of change

  • New feature

Test plan

  • make all PYTEST_JOBS=4 通过,6,435 项通过,50 项跳过。Ruff 和 mypy 通过。

  • uv run pytest -q tests/integration/test_cls_cli.py tests/unit/api/test_openapi_meta.py tests/unit/test_cls_observability.py tests/unit/cli/test_registry.py tests/unit/i18n 通过,105 项通过。

  • 用真实 CLI 子进程和本地 Octop HTTP 服务分别跑通「新建应用 → 查看配置 → 测试连接」和「绑定已有 Topic → 查看配置 → 测试连接」。额外覆盖同名复用、交互选择、仅上报权限、认证失败、上报端点返回 403,以及 STS 环境配置切换后保留内网和脱敏设置。

  • 仓库提交钩子通过,Dashboard 生产构建成功。首次运行时有 3 个 Git API 用例受外层 Git 环境影响;隔离临时仓库后,这 3 个用例全部通过。

集成测试使用模拟的腾讯云管理 API 和 OTLP 响应。真实腾讯云账号上的创建与上报仍待实测。

Checklist

  • 已更新 CLI 使用文档与管理 API 参考。

@Bosheng0422
Bosheng0422 merged commit 5c03929 into develop Nov 27, 2026
9 checks passed
@Bosheng0422
Bosheng0422 deleted the feature/cls-cli branch November 27, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants