docs/relabeling.md: improve relabeling tips for scrape targets

This commit is contained in:
Aliaksandr Valialkin 2022-08-18 01:24:26 +03:00
parent aed6e33cb4
commit 570ce15cb8
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -408,10 +408,6 @@ See also [useful tips for target relabeling](#useful-tips-for-target-relabeling)
## How to drop discovered targets
Every discovered target contains a set of meta-labels, which start with `__meta_` prefix.
The specific sets of labels per each supported service discovery labels are listed
[here](https://docs.victoriametrics.com/sd_configs.html#prometheus-service-discovery).
If a particular discovered target shouldn't be scraped, then `action: keep` or `action: drop` relabeling rules
must be used inside `relabel_configs` section.
@ -448,6 +444,11 @@ See also [useful tips for target relabeling](#useful-tips-for-target-relabeling)
# Useful tips for target relabeling
* Every discovered target contains a set of meta-labels, which start with `__meta_` prefix.
The specific sets of labels per each supported service discovery option are listed
[here](https://docs.victoriametrics.com/sd_configs.html#prometheus-service-discovery).
* Every discovered target contains additional labels with `__` prefix other than `__meta_` labels.
See [these docs](#how-to-modify-scrape-urls-in-targets) for more details.
* All the labels, which start from `__` prefix, are automatically removed from targets after the relabeling.
So it is common practice to store temporary labels with names starting with `__` during target relabeling.
* All the target-level labels are automatically added to all the metrics scraped from targets.