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

Consider passing through escaped non-escape sequences #1443

Closed
grobie opened this Issue Mar 1, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@grobie
Copy link
Member

grobie commented Mar 1, 2016

Prometheus is currently very strict about escaped characters if these are not an escape sequence.

This requires characters in regular expressions to be double escaped.

This makes it bit more inconvenient to escape meta characters in regular expressions. More problematic though, it is an issue with Grafana among others, which escapes all kinds of characters by default grafana/grafana#2918.

If we just ignore such cases, we should make it easier for people to escape meta characters in regular expressions. It should be backwards compatible, as a currently escaped backslash will continue to work.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 1, 2016

Trying to do magic with escaping is risky, as it makes it unclear exactly which layer is interpreting which escape sequences. It gets to be even more fun if a layer changes the escape sequences it knows about.

I'm for keeping a strict definition of escaping. Letting our users be lax in how many backslashes they must provide is likely to cause more problems than it solves in the long run.

This makes it bit more inconvenient to escape meta characters in regular expressions.

That's completely normal. If we want to avoid that in a sane way we'd have to look at something like Python's r string literal modifier - which we already pretty much have via backticks.

@grobie

This comment has been minimized.

Copy link
Member Author

grobie commented Mar 1, 2016

Oh, to be honest, I didn't know about the backtick behavior. So instead of changing the behavior of the backslash, we'd need to ask users to use backticks in such situations? This sounds reasonable to me.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 1, 2016

Backticks can't handle backticks inside them, so to be fully generic a client would have to support our escaping.

@grobie grobie closed this Mar 2, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.