added (working) proxy support
This commit is contained in:
parent
0494c4907a
commit
2c33fcc9cf
2 changed files with 40 additions and 1 deletions
|
|
@ -17,3 +17,25 @@
|
|||
target_label: instance
|
||||
- replacement: 'node'
|
||||
target_label: job
|
||||
|
||||
{% for j in prometheus_agent.scrapers[item].proxy|d({}) %}
|
||||
- job_name: "prometheus-agent - proxy - {{ j }} : {{ inventory_hostname }}"
|
||||
scheme: https
|
||||
{% for i in ['scrape_timeout', 'scrape_interval'] if prometheus_agent[i] %}
|
||||
{{ i }}: {{ prometheus_agent[i] }}
|
||||
{% endfor %}
|
||||
static_configs:
|
||||
- targets:
|
||||
- {{ inventory_hostname }}:{{ prometheus_agent.scrapers[item].proxy[j] }}
|
||||
labels: {{ merged_prometheus_labels|to_json }}
|
||||
tls_config:
|
||||
ca_file: /etc/prometheus/targetcerts/{{ inventory_hostname }}.crt
|
||||
cert_file: /etc/ssl/prometheus_scraper.crt
|
||||
key_file: /etc/ssl/private/prometheus_scraper.key
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
regex: '([^:]+):\d+'
|
||||
target_label: instance
|
||||
- replacement: '{{ prometheus_agent.agents.proxy.mappings[j].job }}'
|
||||
target_label: job
|
||||
{% endfor %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue