cortex-tenant icon indicating copy to clipboard operation
cortex-tenant copied to clipboard

Support matching on multiple labels

Open matthewjstanford opened this issue 1 year ago • 0 comments
trafficstars

In our environment we have several different metric labels that could all indicate what tenant the metric should belong to. Could we add support for multiple label matches, in a sort of hierarchy?

For example, here is the current configuration:

tenant:
  label: namespace

But we would like to prefer a label of tenant if it exists, and also some of our metrics labels are rewritten exported_label, so we'd prefer that as well.

Looking for something like this:

tenant:
  label_list:
    - tenant
    - exported_namespace
    - namespace

This wouldn't need to be a breaking change. We can use the list logic only if the list is set, otherwise it will default to the original behavior.

Does this sound like a good addition? If so I can get a PR together for this.

matthewjstanford avatar Jan 04 '24 20:01 matthewjstanford