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

Enhance convertGraphiteTargetToPromQL() #472

Merged
merged 2 commits into from May 27, 2020

Conversation

rodio
Copy link
Contributor

@rodio rodio commented May 27, 2020

  • In the previous version of the convertGraphiteTargetToPromQL function, an asterisk was matched to one or more symbols. Still, according to the graphite documentation it should match zero or more characters, so this is fixed in this PR.
  • It did not escape all the possible regexp symbols that can be part of the query. This is fixed by regexp.QuoteMeta() now.
  • For some reason, four backslashes were used to escape dots. We did not understand why so this new version adds two backslashes for each dot: one is added by regexp.QuoteMeta() and another by %q formatting instead of %s.

Thanks, @valyala for the convertGraphiteTargetToPromQL function.

@Civil Civil merged commit 5d0f79a into go-graphite:master May 27, 2020
@rodio rodio deleted the graphite-promql branch June 1, 2020 10:04
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.

None yet

2 participants