Repository navigation
Conversation
Enum(states=['a', 'b', 'a']) exposes e{e="a"} twice in one family. After
state('a') the two samples disagree, 1.0 and 0.0, and the OpenMetrics
parser keeps only the first. Raise at construction, before registration,
as duplicate label names already do.
Signed-off-by: Christopher Krah <48338417+chrikrah@users.noreply.github.com>
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.
Enumaccepts astateslist with a repeated entry and exposes one sample per entry, so the family carries twoe{e="a"}samples. Afterstate('a')they disagree, and the OpenMetrics parser keeps only the first.That breaks the OpenMetrics StateSet rule, "StateSets MUST have one sample per State", and
enum.md, which promises one time series per state. The check sits with the otherEnumargument checks, ahead ofsuper().__init__(), so a rejected metric is never registered, as #1189 arranged for emptystates.Verification
There is no issue for this. #1234 rewrites the same lines of
Enum.__init__to accept an enum class, whose member names cannot repeat, so whichever lands second needs a one-line rebase.@csmarchbanks, this raises for the reason you gave on #1214: a repeated state is almost certainly a typo. A caller who has one today gets a
ValueErrorat construction in place of a contradictory sample. Happy to land it before or after #1234, whichever you merge first.