File tree Expand file tree Collapse file tree
basic-prometheus-file_sd_config-cluster Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,4 +176,3 @@ written to stdout
176176
177177### Author
178178[ Serguei Kouzmine] ( kouzmine_serguei@yahoo.com )
179-
Original file line number Diff line number Diff line change @@ -8,14 +8,30 @@ scrape_configs:
88 - files :
99 - /etc/prometheus/dynamic_targets.json
1010 refresh_interval : 15s
11+
1112 relabel_configs :
13+ # Forward the target URL (with ts) as a param to json_exporter
14+ - source_labels : [__meta_filepath]
15+ target_label : source_file
16+
1217 - source_labels : [target]
1318 target_label : __param_target
14- - source_labels : [module]
15- target_label : __param_module
16- - target_label : __address__
17- replacement : exporter:7979
19+
20+ # Keep the actual scrape address
21+ - source_labels : [__address__]
22+ target_label : __address__
23+
24+ # Strip `?ts=...` from the "instance" label to stabilize the time series identity
1825 - source_labels : [target]
26+ regex : (http://[^?]+)\?ts=.*$
1927 target_label : instance
20-
28+ replacement : $1
29+ action : replace
30+
31+ # Same for the "target" label (optional if you graph on this)
32+ - source_labels : [target]
33+ regex : (http://[^?]+)\?ts=.*$
34+ target_label : target
35+ replacement : $1
36+ action : replace
2137
You can’t perform that action at this time.
0 commit comments