Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd function to support replacing label values like regexp.ReplaceAllString #3997
Comments
Wing924
changed the title
[feature request] add function to support replacing label values like regexp.ReplaceAllString
Add function to support replacing label values like regexp.ReplaceAllString
Mar 22, 2018
This comment has been minimized.
This comment has been minimized.
|
This sort of thing is best fixed in your source data. Regexes in PromQL are anchored, which are not compatible with global replacements. |
brian-brazil
closed this
Apr 3, 2018
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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
bot
locked and limited conversation to collaborators
Mar 22, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Wing924 commentedMar 22, 2018
have a metrics like
resp_time_sum{vip="www_example_com"}.I want to replace
_with.in vip label:resp_time_sum{vip="www.example.com"}Currently,
label_replacefunction can't do this because we can't know how many_the value contains.I asked this question in prometheus-users, but the suggest rename label in exporters.
Because we can't always change the exporters, I think add a new function
label_gsubmay be useful.gsub come from ruby's gsub