Fix Studio telemetry account ID resolution - #974
Merged
yaozheng-fang merged 2 commits intoAug 24, 2026
Merged
Conversation
yaozheng-fang
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
studio_session_started/studio_entry_viewed事件能正常带上其他上下文,但account_id为空。结合排查结论,原因可能来自旧 Studio 自更新链路未补齐 account id,或部署 / 更新时 STS 解析失败后缺少可观测错误信息。变更
Studio account id 解析与诊断
veadk/cli/studio_account_id.py,统一封装 Studio account id 解析逻辑:优先复用环境变量,其次从 VeFaaS Function owner / role 推断,再尝试 STS,最后从固定VEADK_STUDIO_TOS_BUCKET命名中兜底解析。VEADK_STUDIO_ACCOUNT_ID;解析失败不会阻塞部署,会写入VEADK_STUDIO_ACCOUNT_ID_RESOLUTION_ERROR。/web/ui-config新增accountIdResolutionError,前端 telemetry context 透传并在studio_entry_viewed、studio_session_started中上报account_id_resolution_error。Studio agent deploy失败原因上报
safeTelemetryErrorMessage,只允许studio_agent_deploy携带脱敏和长度限制后的error_message,其余事件仍只保留稳定的error_kind/error_code/failed_phase。error_message上报,用户取消部署也记录为脱敏后的 abort 错误摘要。docs/studio-tea-telemetry.md,明确studio_agent_deploy.error_message的数据边界、构建日志来源、尾部保留和后端重试行为。tests/cli/test_frontend_deploy_errors.py、frontend/tests/teaTelemetry.test.mjs、frontend/tests/agentWorkspace.test.mjs等覆盖部署错误日志、错误消息脱敏截断、事件 allowlist 与前端部署失败上报。测试
.venv/bin/pre-commit run --all-files.venv/bin/python -m pytest tests/cli/test_studio_account_id.py tests/cli/test_studio_telemetry.py tests/cli/test_frontend_runtime_proxy.py::test_ui_config_serves_studio_telemetry_config tests/frontend/server/test_studio_update_resources.py tests/cli/test_studio_update.py tests/cli/test_studio_deploy_target.py tests/cli/test_frontend_deploy_errors.py -q,结果:105 passed,4 warningsnpm --prefix frontend test -- tests/teaTelemetry.test.mjs tests/studioAccess.test.mjs,结果:763 passedcd frontend && npx tsc --noEmit