Repository navigation
Base64-encode "." and ".." in Pushgateway URL path segments - #1251
Open
sarankumar1325 wants to merge 1 commit into
Open
sarankumar1325 wants to merge 1 commit into
sarankumar1325 wants to merge 1 commit into
Conversation
A job or grouping key value of "." or ".." was put into the URL path
as is. These are dot segments: the Pushgateway router cleans the path
and answers with a 307 redirect to a different group (".." points at
the parent), so push_to_gateway, pushadd_to_gateway and
delete_from_gateway fail with "HTTP Error 307". Encode such values
with base64, as client_golang does.
Signed-off-by: sarankumar1325 <120080287+sarankumar1325@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.
push_to_gateway,pushadd_to_gatewayanddelete_from_gatewayput a job or grouping key value of.or..into the URL path unchanged, for example/metrics/job/my_job/instance/... Those are dot segments. The Pushgateway router cleans the path and replies with a 307 redirect to a different group (..points at the parent group), so the call fails withHTTP Error 307: Temporary Redirect.This change base64-encodes these two values, the same way values with
/or spaces are already handled. client_golang'spushpackage does the same thing.Reproduction against Pushgateway v1.11.5:
Tests:
test_push_with_groupingkey_dot_segmentsandtest_push_with_dot_segment_jobtotests/test_exposition.py. Both fail on master and pass with this change..and..values now succeed.I used an AI assistant while preparing this change. I reviewed and tested it myself.