add support for params and different metrics paths for proxied exporter

This commit is contained in:
nd 2021-09-25 23:54:33 +02:00
parent dcb85ef10a
commit c769595755
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
2 changed files with 6 additions and 1 deletions

View file

@ -242,6 +242,7 @@ prometheus_agent:
jobs: {} jobs: {}
scrape_timeout: ~ scrape_timeout: ~
scrape_interval: ~ scrape_interval: ~
metrics_path: ~
scrapers: {} scrapers: {}
ansible_groups_as_labels: True ansible_groups_as_labels: True
labels: {} labels: {}

View file

@ -58,8 +58,12 @@
{% for j in prometheus_agent.scrapers[item].proxy|d({}) %} {% for j in prometheus_agent.scrapers[item].proxy|d({}) %}
- job_name: "prometheus-agent - proxy - {{ j }} : {{ inventory_hostname }}" - job_name: "prometheus-agent - proxy - {{ j }} : {{ inventory_hostname }}"
scheme: https scheme: https
{% for i in ['scrape_timeout', 'scrape_interval'] if prometheus_agent[i] or i in prometheus_agent.agents.proxy.mappings[j] %} {% for i in ['scrape_timeout', 'scrape_interval', 'metrics_path'] if prometheus_agent[i] or i in prometheus_agent.agents.proxy.mappings[j] %}
{{ i }}: {{ prometheus_agent.agents.proxy.mappings[j].get(i, prometheus_agent[i]) }} {{ i }}: {{ prometheus_agent.agents.proxy.mappings[j].get(i, prometheus_agent[i]) }}
{% endfor %}
params:
{% for i in prometheus_agent.agents.proxy.mappings[j].params|d({}) %}
{{ i|to_json }}: {{ prometheus_agent.agents.proxy.mappings[j].params[i]|to_json }}
{% endfor %} {% endfor %}
static_configs: static_configs:
- targets: - targets: