What are `label_replace()` and `label_join()`?

IntermediateConceptPromQL & Recording Rules
Answer

They create or rewrite labels at query time with a regex:

label_replace(up, "host", "$1", "instance", "(.*):.*")
label_join(up, "target", "/", "job", "instance")

Useful to align labels before vector matching (for example instance with port vs node without). If you need it on every query, fix it in relabeling instead.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL & Recording Rules