Feedback

Chat Icon

Observability with Prometheus and Grafana

A Complete Hands-On Guide to Operational Clarity in Cloud-Native Systems

Relabeling: Best Practices
44%

Understand Edge Cases and Special Labels

When using relabeling in Prometheus, it's important to understand several edge cases and special internal labels that affect scraping and target behavior.

Common Edge Cases

  • Missing __address__: If the __address__ label is missing, Prometheus will drop the target and no metrics will be scraped.

  • Missing Port in __address__: If __address__ lacks a port, Prometheus automatically appends one based on the __scheme__ value. For http or an empty scheme, the port defaults to 80; for https, it defaults to 443.

  • __address__ Contains a Slash: If the value of __address__ contains / (e.g., localhost:9090/), the target will be dropped because it’s not a valid host:port pair.

  • Automatic Removal of Internal Labels: After user-defined relabeling rules are applied, Prometheus automatically removes all labels that start with double underscores (__). This includes labels such as __address__, __metrics_path__, and __scheme__, which are used internally and should not appear in the final metric set.

Special Labels Reference

LabelDescriptionDefault ValuePurpose
__name__The metric name from scraped data. Not part of discovered labels.N/AIdentifies the metric being scraped.
__address__The TCP address of the scrape target (:

Observability with Prometheus and Grafana

A Complete Hands-On Guide to Operational Clarity in Cloud-Native Systems

Enroll now to unlock all content and receive all future updates for free.