Hi,I have an info metric with all possible tag valuestag_info{tag="small"} 1
tag_info{tag="medium"} 1
tag_info{tag="big"} 1tag_info{tag="azure"} 1
tag_info{tag="aws"} 1I have an info metric with a multi-value label called "tags", as a csv with commas envelopevm_info{name="BBBBB" tags=",big,aws,"} 1
vm_info{name="AAAAA" tags=",big,azure,"} 1vm_info{name="CCCCC" tags=",small,aws,"} 1I want to get how many machines have that specific tag:{tag="big"} 2
{tag="small"} 1
{tag="azure"} 1
{tag="aws"} 2The tags values are not known when coding the query
Any hints? It's a kind-of label_split missing function.
Thanks!PD: I have under the control the exporter to make a metrics refactor.
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/885bc38a-9950-4100-a247-68d1e52f17e7n%40googlegroups.com.
Thank you Brians for your responses!I was hopping this problem could be solved with some dark magic promQL queries. I'd probably go with the vm_tag solution, as it is a general purpose metric that allows queries with group_right vector matching, solving more use cases around "tagging".FYI:To give you some context about why I chosevm_info{name="AAAAA" tags=",big,azure,"} 1is inspiration in prometheus code itself, in the ec2 service discovery code (and others)So it seems this "tagging" pattern is already in the community, but unfortunately does not solves all use cases by itself.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/e5d34bb9-9915-4d3e-8f0d-f0a269d460e9n%40googlegroups.com.