Repository navigation
fix(tracing): use count unit for chat_exception_counter - #1186
Open
RichardoMrMu wants to merge 2 commits into
Open
RichardoMrMu wants to merge 2 commits into
RichardoMrMu wants to merge 2 commits into
Conversation
The chat_exception_counter was created with unit="time" (a duration unit copied from a histogram) while its description says "Number of exceptions". Align it to unit="1" like the sibling skill counters, and add a static regression guard for the counter unit metadata.
…egression
- Add prd-spec/bugfixes/2026-10-27-portal-metrics-counter-unit.{md,zh.md}
- Strengthen test with sibling-counter scope guard (llm/skill units unchanged)
This branch has not been deployed
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.
改动 / Change
veadk/tracing/telemetry/portal_metrics.py中chat_exception_counter用unit="time"(duration 单位,从相邻 histogram 复制),description 为 "Number of exceptions"。改为与同文件 skill 计数器一致的unit="1"。chat_exception_counterwas created withunit="time"(a duration unit copied from a neighboring histogram), while its description says "Number of exceptions". Align it tounit="1", matching the sibling skill counters already in this file.self.chat_exception_counter = self.meter.create_counter( name=Meters.LLM_COMPLETIONS_EXCEPTIONS, - unit="time", + unit="1", description="Number of exceptions occurred during chat completions", )双语 PRD / bilingual PRD:
prd-spec/bugfixes/2026-10-27-portal-metrics-counter-unit.md(+.zh.md)。测试 / Tests
新增
tests/test_portal_metrics_counter_unit.py,仅依赖标准库、不 import google.adk:test_chat_exception_counter_uses_count_unit:断言该 counter 单位为计数单位。test_sibling_counters_unchanged:范围守卫,断言llm_invoke_counter="count"、skill_download/load_counter="1"均未被误改。静态实算 / Static RED/GREEN (no runtime):
2301477(unit="time"):exception counter 断言 FAILED (RED),sibling 守卫 PASSED。6ada3e70(unit="1"):两项 PASSED (GREEN)。Recorder-based runtime test in
test_portal_metrics.pyrequires google.adk and is NOT run locally; left to CI. No runtime green is claimed.Claim / occupancy (limited)
portal_metrics.py(57 open PRs; only 3 touch tracing, different files). Search forchat_exception_counter/portal_metrics= no matching issue.