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 upRegexes are silently anchored #1519
Comments
This comment has been minimized.
This comment has been minimized.
|
This behavior has been changed intentionally in 0.17.0 to the one you are seeing because wanting anchored regexes was seen as the more frequently desired use case. See also: #1518 and the linked changelog entry. |
This comment has been minimized.
This comment has been minimized.
|
This was a change we made on purpose, as not everyone is fully aware of how regexes work and we'd seen a lot of patterns in use that could unintentionally overmatch (consul tags being a common one). |
brian-brazil
added
the
question
label
Apr 1, 2016
This comment has been minimized.
This comment has been minimized.
|
That makes sense. I'd suggest that it's worth documenting well in the |
This comment has been minimized.
This comment has been minimized.
|
It's already documented? https://prometheus.io/docs/operating/configuration/#relabel_config |
pete0emerson
referenced this issue
Apr 1, 2016
Closed
Non-greedy regex in relabel_configs fails #1520
This comment has been minimized.
This comment has been minimized.
|
It'd make sense to briefly mention it in the code block comment above the |
This comment has been minimized.
This comment has been minimized.
grobie
closed this
Apr 2, 2016
This comment has been minimized.
This comment has been minimized.
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. |
pete0emerson commentedApr 1, 2016
I'm seeing this in version 0.17.0.
Suppose
__meta_consul_tagsvalue is,environment:stage,application:webapp,.In
relabel_configs:I would expect this to succeed. However, it fails, and my suspicion is that the regular expressions are anchored silently, because this succeeds:
If my assumption is correct, my suggestion would be that anchoring be not silently added, so if I truly wanted to anchor it, I'd use the regex anchor
^to anchor it to the beginning of the string.