From 386b832e8a6ae6f16b6f3d4a9ea530763c7055ef Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Wed, 2 Sep 2020 17:01:27 +0200 Subject: [PATCH] Add service discovery relabel example to README Signed-off-by: Linus Wallgren --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fb194f..61173d6 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,21 @@ so this workaround is required. The `/clients` endpoint will return a list of all registered clients in the format used by `file_sd_configs`. You could use wget in a cronjob to put it somewhere -file\_sd\_configs can read and then then relabel as needed. +file\_sd\_configs can read and then then relabel as needed. For example: + +``` +scrape_configs: +- job_name: node + proxy_url: http://proxy:8080/ + file_sd_configs: + - files: + - pushprox.json + relabel_configs: + - source_labels: ['__address__'] + regex: '(.*)' + replacement: '$1:9100' + target_label: '__address__' +``` ## How It Works