Repository navigation
fix(ws): keep watched pairs as metric labels, bound only the unknown ones - #426
Open
Miracle656 wants to merge 1 commit into
Open
Miracle656 wants to merge 1 commit into
Miracle656 wants to merge 1 commit into
Conversation
6 tasks done
…ones #401 closed the cardinality hole in ws_clients_total / ws_messages_sent_total / ws_messages_dropped_total by folding every pair-specific subscription into `other`. That is safe — no client-supplied string can mint a series — but it also costs all per-pair visibility: {pair="other"} and {pair="*"} together are barely more than one number, so "which pair actually has subscribers" stops being answerable. config.pairs is operator-defined and fixed for the life of the process, which makes it a bounded label domain. A subscription to a watched pair now keeps its own label; everything else still collapses into `other`. The safety property is unchanged: the whole unbounded space is one series. The test environment configures no pairs, so the test stubs one — without that the watched-pair branch is unreachable and the assertion would pass for the wrong reason. Claude-Session: https://claude.ai/code/session_01USgemLt4Rnz4SGB1Srf3GB
Miracle656
force-pushed
the
followup-pairlabel
branch
from
October 19, 2026 14:11
e5e905b to
fcaa771
Compare
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.
Follow-up to #401, which I merged. That PR closed the cardinality hole correctly — after it, no client-supplied string could mint a Prometheus series — but it folded every pair-specific subscription into
other, which also removed all per-pair visibility.{pair="other"}and{pair="*"}together are barely more than one number, so "which pair actually has subscribers" stopped being answerable on the dashboard.config.pairsis operator-defined and fixed for the lifetime of the process, which makes it a bounded label domain. So:otherThe safety property is unchanged: the entire unbounded space is exactly one series.
On the test
The test environment configures no pairs at all, so
config.pairsis empty and the watched-pair branch would never execute — the assertion would have passed for the wrong reason. The test stubs a single watched pair throughvi.mock('../config')withimportOriginal, becausefanout.tsreadsconfig.pairsonce at module load.src/__tests__/fanout.test.ts: 8 passed.tsc --noEmitclean.Credit for the original fix and the metric-label test harness goes to @Jossy-ossy in #401 — this only refines the label domain.
https://claude.ai/code/session_01USgemLt4Rnz4SGB1Srf3GB