There are currently several ways to filter what metrics should be returned by /admin/metrics but they have one important limitation: all types of filtering criteria (group, type, prefix, regex, key) use implicit OR, so it's only ever possible to broaden the filters but not to narrow them down.
This issue came up while I was reviewing the default Prometheus exporter config and I noticed that it pulls ALL metrics. This is extremely wasteful and puts unnecessary load on the nodes, especially since only some of the metrics are then used, either by the exporter itself or by the default dashboard. In addition to that, the exporter needs to build an object tree from all these metrics in order to apply the export rules, which leads to excessive memory / cpu consumption in the reporter process.
We should come up with a way to make these filters more expressive so that it's possible e.g. to select only some metrics from a particular registry.
The simplest way to implement this would be to extend the syntax of the key parameter to support regex expressions in the parts of the key that specify the metric name and the property name.