Hi Brian, thanks for your quick response, this is exactly what I need and a way it should work. Perhaps I didn' read the fucking manual in detail, sorry.
Have a nice weekend. Regards Eric Am Freitag, 7. August 2020 13:31:41 UTC+2 schrieb Brian Candler: > > On Friday, 7 August 2020 09:16:18 UTC+1, Eric wrote: >> >> My Question: >> The targets have to be defined in the prometheus.yml, they can't be >> defined in blackbox.yml as far as I understand. >> >> > The targets are defined as prometheus targets, but they don't have to be > static_sd_configs. They can be in other files using file_sd_configs. > > >> Is there a possibility to split the prometheus.yml config, in oder to >> have more configs with different file permissions? >> >> > Yes. file_sd_configs can point to one or more target files. > > Doing this neatly involves using a little label rewriting. Here is a > config you can base on: > > - job_name: blackbox > file_sd_configs: > - files: > - /etc/prometheus/targets.d/foo_targets.yml > - /etc/prometheus/targets.d/bar_targets.yml > metrics_path: /probe > relabel_configs: > - source_labels: [__address__] > target_label: instance > - source_labels: [__address__] > target_label: __param_target > - source_labels: [module] > target_label: __param_module > - target_label: __address__ > replacement: 127.0.0.1:9115 # Blackbox exporter > > Then in the targets files you can write things like this: > > - labels: > module: http_2xx > targets: > - http://www.google.com/ > - http://www.youtube.com/ > - labels: > module: http_3xx > targets: > - http://www.example.com > > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/7bfcf5ad-bcde-4375-a77a-9cd1c48ecfd6o%40googlegroups.com.

