prom: increase scrape_interval for quanta targets
This commit is contained in:
parent
4ae69ceb89
commit
c5cc75e826
2 changed files with 5 additions and 4 deletions
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue