Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support slashes in pgw grouping keys. #442

Merged
merged 1 commit into from
Jul 25, 2019
Merged

Support slashes in pgw grouping keys. #442

merged 1 commit into from
Jul 25, 2019

Conversation

brian-brazil
Copy link
Contributor

Signed-off-by: Brian Brazil brian.brazil@robustperception.io

@beorn7

def _escape_grouping_key(k, v):
if '/' in v:
# Added in Pushgateway 0.9.0.
return k + "@base64", base64.b64encode(v.encode("utf-8")).decode("utf-8")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use base64.urlsafe_b64encode to avoid / and + in the result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
@brian-brazil brian-brazil merged commit a8f5c80 into master Jul 25, 2019
@brian-brazil brian-brazil deleted the pgw-slash branch July 25, 2019 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants