prom: increase scrape_interval for quanta targets

This commit is contained in:
jeltz 2025-01-02 15:08:03 +01:00
parent 4ae69ceb89
commit c5cc75e826
Signed by: jeltz
GPG key ID: 800882B66C0C3326
2 changed files with 5 additions and 4 deletions

View file

@ -3,7 +3,8 @@ prometheus__scraping_quanta:
targets: "{{ groups.quanta }}" targets: "{{ groups.quanta }}"
address: 127.0.0.1:9116 address: 127.0.0.1:9116
path: /snmp path: /snmp
timeout: 60s timeout: 180s
interval: 180s
params: params:
module: module:
- quanta - quanta

View file

@ -9,9 +9,7 @@ class FilterModule:
def convert_jobs(config): def convert_jobs(config):
for name, job in config.items(): for name, job in config.items():
config = { config = {
"job_name": name, "job_name": name,
"static_configs": [ "static_configs": [
@ -28,8 +26,10 @@ def convert_jobs(config):
if "timeout" in job: if "timeout" in job:
config["scrape_timeout"] = job["timeout"] config["scrape_timeout"] = job["timeout"]
if "address" in job: if "interval" in job:
config["scrape_interval"] = job["interval"]
if "address" in job:
try: try:
replacement = f"$1:{job['address']['port']}" replacement = f"$1:{job['address']['port']}"
except Exception: except Exception: