Added support for regex label
This PR about support regex label #27.
Main idea is to recognise matcher from query and keep matcher instead label in context.
It allow to use multiple namespaces via query like namespace=~kube-system|openshift-monitoring and still works with one namespace without regex.
query parameter for different types: 👍
a bit tricky :)
q.Add("namespace", "monitoring") // MatchEqual
q.Add("namespace", "~monitoring|default") // MatchRegexp
q.Add("namespace", "!monitoring") // MatchNotEqual
q.Add("namespace!~monitoring|default", "") // MatchNotRegexp: empty value, all in keys
It makes more sense when converted to query URL :)
namespace
I think it makes more sense to have
q.Add("namespace, "!~monitoring|default")
as match not regexp. The syntax then would be namespace=!~monitoring|default but it makes more sense when having query added via function, and also can be used together with features such as https://github.com/prometheus-community/prom-label-proxy/pull/116 -label-value
Hello ! I would love to be able to use a regex matcher in labels ! What is blocking this PR ?
See somewhat related https://github.com/prometheus-community/prom-label-proxy/pull/171.
From a quick look, #171 should achieve the same goal. Closing this one as it has merge conflicts anyway.