Identifiers as label names in metrics - Best Practice

Hi all!

I am right now implementing a use case where we need a TSDB and we decided to use Prometheus (Mimir).

I have the following design problem
We have names that can be changed in the labels of the metrics we want to measure (e.g. hostname, service name, … ).
So we had the idea to use identifiers we already have in our RDBMS. But this results in difficulties such as that the labels cannot be understood anymore without the metadata of our RDBMS and also queries would be hard to build.

An example to better understand what I mean
A query would look something like:
metric_name{hostId=123, serviceId=456, ...}

My questions

  • Is there best practice for this kind of problem?
  • Is relabeling computing intensive? This design approach was only considered because we thought relabeling could be very resource-consuming.

I hope a similar question was not asked before. I did not find anything for sorry.
Thank you in advance!