test(telemetry): Cover daemon metrics init ordering and document metricReader asymmetry - #7456
Conversation
…icReader asymmetry
|
Thanks for the PR! Template looks good ✓ (minor: the "Evidence (Before & After)" heading is missing — would just be N/A here — and the Chinese Problem: observed gap, not theoretical. Both items were raised as non-blocking review suggestions in #7276 — the init-ordering guarantee had no test, and the Direction: aligned. Test coverage for a load-bearing async ordering guarantee, plus a comment preventing a future "cleanup" from breaking the SDK config. CHANGELOG: no direct reference, but this is follow-up hygiene on a merged feature — squarely in scope. Size: Approach: minimal and focused — one test, one comment. Exactly what the #7276 review asked for. Nothing to cut. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓(小瑕疵:缺少 "Evidence (Before & After)" 标题——此处只需填 N/A——以及缺少中文翻译,但对测试+注释 PR 无实质影响)。 问题:已观测到的缺口,非理论性加固。两项均来自 #7276 的非阻塞 review 建议——初始化顺序保证缺少测试, 方向:对齐。为承载性的异步顺序保证添加测试覆盖,加注释防止未来"清理"破坏 SDK 配置。 规模: 方案:最小且聚焦——一个测试、一条注释。正是 #7276 review 所建议的。无可删减。 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
Code ReviewIndependent proposal: given the problem (killed/SIGTERM is dead code because the outer Correctness:
No critical blockers. No convention violations. TestingUnit tests: 40/40 pass ( Direct module verification (built PR code, exercising All classifications match the PR's stated intent. The tmux: not available on this CI runner ( 中文说明代码审查独立方案: 鉴于问题(killed/SIGTERM 是死代码,因为外层 正确性:
无关键阻塞。无规范违反。 测试单元测试: 40/40 通过。 直接模块验证(构建 PR 代码):所有分类符合 PR 声明的意图。 tmux: 此 CI 运行器不可用。直接模块验证已端到端测试了分类逻辑。 — Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 5/5 Clean follow-up to #7276 review feedback. One test that correctly pins the async init ordering, one comment that documents a real SDK asymmetry. Both are minimal, accurate, and follow existing conventions. All 190 tests in the file pass, typecheck is clean. Nothing to change. LGTM, approving. ✅ 中文说明置信度:5/5 干净的 #7276 review 反馈跟进。一个测试正确固定了异步初始化顺序,一条注释记录了真实的 SDK 不对称性。两者都最小化、准确、遵循现有规范。文件中全部 190 个测试通过,类型检查通过。无需修改。 LGTM,批准。✅ — Qwen Code · qwen3.7-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
🩺 serve daemon A/BBuilt the PR base vs this PR head ✅ No response changes against the PR base across 4 scenario(s). — Qwen Code · serve A/B |
Review — PR #7456Tidy follow-up; both items raised in #7276 landed cleanly. I checked the two claims against the actual
|
test(telemetry): cover daemon metrics init ordering and document metricReader asymmetry
What this PR does
Two small follow-ups to the lazy telemetry SDK work that merged in #7276, both raised as non-blocking review suggestions there. First, it adds a test asserting that daemon metrics initialization only runs after telemetry initialization has fully settled — the dependency became asynchronous in #7276 and previously had no ordering assertion. Second, it documents why the SDK options use the singular
metricReaderfield while traces and logs pass processor arrays:@opentelemetry/sdk-node@0.203.0accepts only one metric reader and offers no empty-array opt-out, so env-based reader auto-configuration can only be suppressed by providing an explicit reader — an intentional asymmetry that is easy to "fix" incorrectly.Why it's needed
The init-ordering guarantee is load-bearing (metrics recorded before the provider exists are dropped) but was only enforced by code shape, not by a test. The comment prevents a future cleanup from converting
metricReaderto ametricReaders: []pattern that the SDK does not support.Reviewer Test Plan
How to verify
cd packages/cli && npx vitest run src/serve/run-qwen-serve.test.ts— includes the new ordering test (telemetry-start → telemetry-resolved → daemon-metrics).Tested on
Risk & Scope
Linked Issues
Follow-up to #7276.