From 579b168b2c93daee67ede17ee3289da1678b3833 Mon Sep 17 00:00:00 2001 From: Colin Wilk Date: Thu, 15 Jun 2023 22:40:27 +0200 Subject: Add ability to use exporter without id property The id property of the exporter is used for checking the default values specified in `prometheus_target_exporter_defaults` variable. However when both the `host` and the `path` fields are specified manually in the `prometheus_target_exporter` list this id is never looked up. The way the templating was handled however, still resulted in an error when leaving out the id field. The templating code was now rewritten to allow for the following exporter configuraion to run: prometheus_target_exporter: - { host: exporter_without_id, path: /opt/simple_target4.yml } Signed-off-by: Colin Wilk --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index f3d285c..0cfe278 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,8 @@ Multiple exporters - role: kliwniloc.prometheus_target # deploy targets prometheus_target_exporter: - id: node_exporter # deploy node_exporter with default host + # deploy an exporter that is not specified in prometheus_target_exporter_defaults + - { host: exporter_without_id, path: /opt/simple_target4.yml } # deploy blackbox_exporter with multiple hosts - { id: blackbox_exporter, host: node1.example.org } - { id: blackbox_exporter, host: node2.example.org } -- cgit v1.2.3