What is relabeling, and what are its stages?
IntermediateConceptPrometheus Architecture
Answer
Relabeling rewrites label sets with rules. There are four places:
relabel_configs: before scrape, on targets. Filter targets, set__address__,__metrics_path__,__scheme__, copy__meta_*into real labels.metric_relabel_configs: after scrape, before storage, on every sample. Drop expensive series or labels.alert_relabel_configs: on alerts before sending to Alertmanager.write_relabel_configs: on samples beforeremote_write.
Labels starting with __ are dropped after target relabeling (except they drive the scrape).
More on Prometheus Architecture
Describe the Prometheus architecture.BeginnerWhat does a basic prometheus.yml look like?BeginnerWhat is the `up` metric?BeginnerWhat are `job` and `instance` labels and where do they come from?BeginnerHow is the Prometheus TSDB organized on disk?AdvancedWhat is the WAL and why does Prometheus restart slowly sometimes?Advanced