Prometheus Templating Filtering Group Names

Hey guys so I need some help with something I don’t quite understand. I’m trying to use templating to get a list of label_values that’s filtered out. So as my query I’ll have label_values(group) and that’s great. I get a list of all the values under group. the thing is, how I have it setup, for the values I have prefixes in the group names since the data source collects different types of information. as an example.

Job: job1
    group: pre1_Instance1
    group: pre1_instance2
    group: pre1_instance3
Job: job2
    group: pre2_instance4
    group: pre2_instance5

So when I get the values for label_values(group) I want to be able to filter out for the ones that start with a specific prefix. Instead of getting a list of all of the values for group, just the ones that would pertain to that dashboard. Would it be better to structure what I have differently?

I’ve switched to using different label names for each set instead of relying on the prefix, which works. But it would still be nice to know if there is a way to filter out information like this for templating. Thanks


You can use the regex field for filtering out certain parts.