Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for regex label #100

Closed
wants to merge 1 commit into from

Conversation

NikWaltz
Copy link

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.

@m-yosefpor
Copy link

m-yosefpor commented Aug 13, 2022

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
Copy link

m-yosefpor commented Aug 13, 2022

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

@gillg
Copy link

gillg commented Mar 10, 2023

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

@sathieu
Copy link
Contributor

sathieu commented Dec 21, 2023

See somewhat related #171.

@simonpasquier
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants