- Notifications
You must be signed in to change notification settings - Fork10k
docs: Update PromQL basics.md with more examples on regex escaping#17635
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
As discussed inhttps://cloud-native.slack.com/archives/C01AUBA4PFE/p1764678392087529Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
| This can be useful for[`regex expressions`](#regular-expressions) on the regex-match selectors, for example: | ||
| {le=~"0\\.5"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
These examples illustrate using escaping in label matcher label value regexes, but this is the section about PromQL string literals. The "strings" in label matchers are not a string literal in the PromQL sense, but just a syntactic part of a vector selector node (not their own expression). So I would either move this to wherever label matchers are explained, or use a different example here where you have to escape something in a PromQL string literal - probably only in the case of thelabel_replace() function regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Makes sense, will move to matchers. Perhaps leave this too, but converted to label replace example, thanks!
As discussed inhttps://cloud-native.slack.com/archives/C01AUBA4PFE/p1764678392087529
Does this PR introduce a user-facing change?