-
-
Save zukko78/165166de96ece054b99997f76e684aa0 to your computer and use it in GitHub Desktop.
Prometheus Relabel Config Examples - https://prometheus.io/docs/operating/configuration/#<relabel_config>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 60s | |
external_labels: | |
monitor: 'example' | |
rule_files: | |
- /etc/prometheus/config/*.rules | |
scrape_configs: | |
- job_name: 'scrape-then-use-relabel-to-rename-selected-metrics' | |
static_configs: | |
- targets: ['10.10.10.1:19126'] | |
metric_relabel_configs: | |
- source_labels: [ __name__ ] | |
target_label: __name__ | |
regex: '(^(?:go|http|process)_.*$)' | |
action: replace | |
replacement: telegraf_${1} | |
- job_name: 'scrape-then-use-relabel-to-remove-a-label' | |
static_configs: | |
- targets: ['10.10.10.2:19126'] | |
metric_relabel_configs: | |
- source_labels: [ host ] | |
target_label: host | |
action: replace | |
replacement: '' | |
- job_name: 'scrape-then-use-relabel-add-an-arbitrary-label' | |
static_configs: | |
- targets: ['10.10.10.3:19126'] | |
metric_relabel_configs: | |
- source_labels: [ instance ] | |
target_label: instance | |
action: replace | |
replacement: log-downloader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment