Rename metrics to contain label names

Hi, is there any way to change a metric like

metric_name{instance"=“hostname:port”,“type”=“thismetrictype”} value

into eg.

metric_name_thismetrictype{“instance”=“hostname:port”} value

(well, the “type=thismetrictype” can of course also remain in the label section, it does not have to be removed there).

We do use relabel_configs for some of our metrics, but this obviously is only able to change the labels, not the metric names. Any other was to do this?

Cheers, Olaf

You can use target_label: __name__ when doing metric_relabel_configs to change the metric name.