feat: added traefik to prometheus scrape configuration

master
Sven Ketelsen 5 years ago
parent 4b8ea52d05
commit 3077579fd6

@ -42,6 +42,27 @@ scrape_configs:
target_label: instance target_label: instance
replacement: '{{ service_prefix }}prometheus.{{ domain }}' replacement: '{{ service_prefix }}prometheus.{{ domain }}'
##############################################
- job_name: 'traefik'
scheme: {{ http_s }}
metrics_path: '/metrics'
static_configs:
- targets: [
{% for host in groups['all'] | default([]) %}
'{{ host }}.{{ domain }}:{{ monitor_port_service }}',
{% endfor %}
]
labels:
env: {{ stage }}
project: smardigo
application: traefik
relabel_configs:
- source_labels: [__address__]
regex: (.*):.*
target_label: instance
replacement: $1
############################################## ##############################################
- job_name: 'connect' - job_name: 'connect'
@ -49,9 +70,6 @@ scrape_configs:
metrics_path: '/management/prometheus' metrics_path: '/management/prometheus'
static_configs: static_configs:
- targets: [ - targets: [
{% for target in prometheus_targets_connect | default([]) %}
{{ target }}
{% endfor %}
{% for host in groups['connect'] | default([]) %} {% for host in groups['connect'] | default([]) %}
'{{ host }}-connect.{{ domain }}:{{ monitor_port_service }}', '{{ host }}-connect.{{ domain }}:{{ monitor_port_service }}',
{% endfor %} {% endfor %}

Loading…
Cancel
Save