Hi!
I was trying to use metric_relabel_configs in order to change the label content (sourcing from another label) of a metric.
The original metric looks like this:
In our case, because we are scraping a central endpoint, our short_hostname will carry the label of the actual scraped target. Ideally, I would want short_hostname to be changed to qasite1-compute001.
I've tried using the following metric_relabel_configs, but while it doesn't break anything, it doesn't seem to change the labels when looking at Prometheus.
metric_relabel_configs:
# Change the nova metric short_hostname to the compute name.
- source_labels: ["openstack_nova"]
regex: '([a-z]+.-compute\d\d\d)'
target_label: "short_hostname"
action: replace
replacement: "$1"
This is placed within the job block that contains that scrape job.
Anything else I would need to double-check here? The Regex seems ok according to RE2 parsers, the syntax seems correct as well.
Thanks!