diff --git a/group_vars/prom/prometheus/quanta.yml b/group_vars/prom/prometheus/quanta.yml index 682d062..e23ca1a 100644 --- a/group_vars/prom/prometheus/quanta.yml +++ b/group_vars/prom/prometheus/quanta.yml @@ -3,7 +3,8 @@ prometheus__scraping_quanta: targets: "{{ groups.quanta }}" address: 127.0.0.1:9116 path: /snmp - timeout: 60s + timeout: 180s + interval: 180s params: module: - quanta diff --git a/roles/prometheus/filter_plugins/prometheus.py b/roles/prometheus/filter_plugins/prometheus.py index 036d8d5..26c8fd1 100644 --- a/roles/prometheus/filter_plugins/prometheus.py +++ b/roles/prometheus/filter_plugins/prometheus.py @@ -9,9 +9,7 @@ class FilterModule: def convert_jobs(config): - for name, job in config.items(): - config = { "job_name": name, "static_configs": [ @@ -28,8 +26,10 @@ def convert_jobs(config): if "timeout" in job: config["scrape_timeout"] = job["timeout"] - if "address" in job: + if "interval" in job: + config["scrape_interval"] = job["interval"] + if "address" in job: try: replacement = f"$1:{job['address']['port']}" except Exception: