Add support to set custom labels for Prometheus

The Prometheus integration currently sets a fixed set of labels (domain, entity and friendly_name).
Unfortunately these labels are hardly enough to group sensors (e.g. to get the temperature of all sensors on the ground floor).
Although such grouping can be done with regular expressions on the entity, using regexes is slow and requires that all needed information is packed into the entity names.

Further more the current set of labels contains labels, which are probably not needed by everybody (e.g. the domain) or contain data, which would need re-mapping (e.g. the friendly_name may contain values, which are good inside Home Assistant, but not usable in Prometheus).

-> Please add the option to add custom labels in the Prometheus configuration and the option to omit the current fixed labels.

I’d also love to see this.

Maybe this would be simpler: I’d be amazing if the metrics would include a label for the zone of the entity, so that I can group the sensor data by location of the home.

2 Likes

Yes that’s excactly what I’m looking for.
I want a device label which contains the device name/id, and the entity id which should not include the device name/id.