add relabeling for better naming/context

This commit is contained in:
Max Rydahl Andersen 2018-10-15 00:44:06 +02:00
parent 47ceb88685
commit db03c54c0d
2 changed files with 23 additions and 9 deletions

View file

@ -1,8 +1,8 @@
- targets: - targets: # url;humanname;routing;switch
- http://google.com - http://google.com;google.com;external;internetbox
- http://github.com - http://github.com;github.com;external;internetbox
- https://blackdata.xam.dk:5001 - https://blackdata.xam.dk:5001;blackdata.xam.dk;external;internetbox
- http://192.168.1.1 - http://192.168.1.1;internetbox;local;internetbox
- http://192.168.1.42 - http://192.168.1.42;blackdata;local;orbirouter-attic
- http://192.168.1.101 - http://192.168.1.101;orbirouter;local;orbirouter

View file

@ -46,9 +46,23 @@ scrape_configs:
- pinghosts.yaml - pinghosts.yaml
relabel_configs: relabel_configs:
- source_labels: [__address__] - source_labels: [__address__]
target_label: __param_target regex: '(.*);(.*);(.*);(.*)' #first is the url, thus unique for instance
- source_labels: [__param_target]
target_label: instance target_label: instance
replacement: $1
- source_labels: [__address__]
regex: '(.*);(.*);(.*);(.*)' #second is humanname to use in charts
target_label: humanname
replacement: $2
- source_labels: [__address__]
regex: '(.*);(.*);(.*);(.*)' #third state whether this is testing external or internal network
target_label: routing
replacement: $3
- source_labels: [__address__]
regex: '(.*);(.*);(.*);(.*)' #fourth is which switch/router the device is connected to.
target_label: switching
replacement: $4
- source_labels: [instance]
target_label: __param_target
- target_label: __address__ - target_label: __address__
replacement: ping:9115 # The blackbox exporter's real hostname:port. replacement: ping:9115 # The blackbox exporter's real hostname:port.