Repository navigation
fix(metrics): drop vcon.uuid from link metrics and guard against per-vCon attributes - #226
Merged
Merged
Conversation
…vCon attributes #154 put vcon.uuid on the metrics of 17 links. Each distinct value is its own time series, and with cumulative temporality every series is re-exported on each interval for the life of the worker, so metric volume grows without bound until a restart. #224 fixed the jq link after it filled a metrics store; this removes the same label from the rest: analyze, analyze_and_label, analyze_vcon, check_and_tag, datatrails, deepgram_link, detect_engagement, diet, groq_whisper, hugging_face_whisper, hugging_llm_link, openai_transcribe, post_analysis_to_slack, sampler, scitt, tag_router and webhook. Span attributes keep the uuid; spans are per-event and do not have this problem. lib.metrics now drops per-vCon keys (vcon.uuid, vcon_uuid, vcon_id, vcon.id) from counter, up/down counter and histogram attributes and warns once per metric, so a new or out-of-tree link cannot reintroduce it. The CON-6 metric tests asserted vcon.uuid was present; they now assert no per-vCon key appears on any data point. With the guard disabled, 3 guard tests fail; with the guard disabled and the links reverted, 27 fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-link test files still asserted vcon.uuid in the attributes passed to the metric helpers. Update them to match the links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
#154 added
vcon.uuidto the metric attributes of 17 links. Every distinct uuid is its own time series. The counters and histograms are cumulative, so each worker re-exports every series it has created on every export interval until the process restarts, and metric volume grows without bound. #224 fixed the jq link after it filled a metrics store (over 1M series and about 460M samples an hour from one counter). The other links have the same flaw at lower volume today; the histograms are the worst case, since each series carries a full set of buckets.Change
vcon.uuidfrom metric attributes in analyze, analyze_and_label, analyze_vcon, check_and_tag, datatrails, deepgram_link, detect_engagement, diet, groq_whisper, hugging_face_whisper, hugging_llm_link, openai_transcribe, post_analysis_to_slack, sampler, scitt, tag_router and webhook (27 call sites). Eachattrsdict was checked to feed only metric calls. The uuid stays in log lines and span attributes, where per-event detail belongs.common/lib/metrics.py:increment_counter,add_updown_counterandrecord_histogramdrop per-vCon keys (vcon.uuid,vcon_uuid,vcon_id,vcon.id) and log a warning once per metric. This is a backstop so a new or out-of-tree link cannot bring the problem back.Tests
conserver/tests/test_link_metrics.pyassertedvcon.uuidwas present.assert_metric_has_attrsnow fails if any data point carries a per-vCon key.TestPerVconAttributeGuardcovers counter, up/down counter and histogram: three uuids in, one series out.Notes for operators
Dashboards or alerts that group or filter link metrics by
vcon.uuidwill lose that dimension. Per-vCon lookups belong in traces or logs.🤖 Generated with Claude Code