Repository navigation
Honor Accept quality values when choosing the metrics format - #1222
Open
zhechen-cs wants to merge 1 commit into
Open
zhechen-cs wants to merge 1 commit into
zhechen-cs wants to merge 1 commit into
Conversation
Signed-off-by: Zhe Chen <zhechen.cs@connect.hku.hk>
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.
choose_encoder()picks the first supported format without checking its quality value. For example,Accept: application/openmetrics-text;version=1.0.0;q=0, text/plain;version=1.0.0currently returns OpenMetrics even though the client rejects it. A lower-quality format also wins if it appears first.Select supported formats in descending quality order, skip zero or invalid weights, and preserve header order for ties. This also lets explicitly preferred legacy text output win over lower-quality OpenMetrics output. The existing text fallback remains available when no supported format matches.
Validation: the new regressions fail on the unmodified base. After the fix, the full suite passes with 431 tests passed and 14 skipped;
tox -e flake8,isort,mypypasses. Local HTTP tests usedNO_PROXY=localhost,127.0.0.1,::1because the configured proxy returns 502 for local requests, including on the clean base.@csmarchbanks