prom-label-proxy icon indicating copy to clipboard operation
prom-label-proxy copied to clipboard

Added support for regex label

Open NikWaltz opened this issue 3 years ago • 2 comments

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.

NikWaltz avatar Dec 30 '21 07:12 NikWaltz

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 :)

m-yosefpor avatar Aug 13 '22 10:08 m-yosefpor

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

m-yosefpor avatar Aug 13 '22 10:08 m-yosefpor

Hello ! I would love to be able to use a regex matcher in labels ! What is blocking this PR ?

gillg avatar Mar 10 '23 09:03 gillg

See somewhat related https://github.com/prometheus-community/prom-label-proxy/pull/171.

sathieu avatar Dec 21 '23 09:12 sathieu

From a quick look, #171 should achieve the same goal. Closing this one as it has merge conflicts anyway.

simonpasquier avatar Dec 22 '23 14:12 simonpasquier