Last active
June 12, 2023 16:17
-
-
Save trastle/1aa205354577ef0b329d4b8cc84c674a to your computer and use it in GitHub Desktop.
Prometheus Relabel Config Examples - https://prometheus.io/docs/operating/configuration/#<relabel_config>
This file contains 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