added support to overwrite scrap intervall
This commit is contained in:
parent
c009ac013b
commit
246842b66e
3 changed files with 6 additions and 1 deletions
|
|
@ -8,3 +8,5 @@ prometheus_agent:
|
||||||
scrapers: {}
|
scrapers: {}
|
||||||
ansible_groups_as_labels: False
|
ansible_groups_as_labels: False
|
||||||
labels: {}
|
labels: {}
|
||||||
|
scrape_timeout: ~
|
||||||
|
scrape_interval: ~
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# Due to shell scaping, to pass backslashes for regexes, you need to double
|
# Due to shell scaping, to pass backslashes for regexes, you need to double
|
||||||
# them (\\d for \d). If running under systemd, you need to double them again
|
# them (\\d for \d). If running under systemd, you need to double them again
|
||||||
# (\\\\d to mean \d), and escape newlines too.
|
# (\\\\d to mean \d), and escape newlines too.
|
||||||
ARGS="{% for i in prometheus_agent.args %} --{{ i }}{% if prometheus_agent.args[i] and prometheus_agent.args[i] != {} %}='{{ prometheus_agent.args[i] }}'{% endif %} {% endfor %}"
|
ARGS="{% for i in prometheus_agent.args %} --{{ i }}{% if prometheus_agent.args[i] and prometheus_agent.args[i] != {} %}={{ prometheus_agent.args[i] }}{% endif %} {% endfor %}"
|
||||||
|
|
||||||
#{{ prometheus_agent.args.keys()|list|join(' ') }}"
|
#{{ prometheus_agent.args.keys()|list|join(' ') }}"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
- job_name: prometheus-agent {{ inventory_hostname }}
|
- job_name: prometheus-agent {{ inventory_hostname }}
|
||||||
scheme: https
|
scheme: https
|
||||||
|
{% for i in ['scrape_timeout', 'scrape_interval'] if prometheus_agent[i] %}
|
||||||
|
{{ i }}: {{ prometheus_agent[i] }}
|
||||||
|
{% endfor %}
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
- {{ inventory_hostname }}:{{ prometheus_agent.scrapers[item] }}
|
- {{ inventory_hostname }}:{{ prometheus_agent.scrapers[item] }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue