diff --git a/templates/prometheus/config/prometheus/prometheus.yml.j2 b/templates/prometheus/config/prometheus/prometheus.yml.j2 index 564db69..6977fe5 100644 --- a/templates/prometheus/config/prometheus/prometheus.yml.j2 +++ b/templates/prometheus/config/prometheus/prometheus.yml.j2 @@ -42,6 +42,27 @@ scrape_configs: target_label: instance 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' @@ -49,9 +70,6 @@ scrape_configs: metrics_path: '/management/prometheus' static_configs: - targets: [ -{% for target in prometheus_targets_connect | default([]) %} - {{ target }} -{% endfor %} {% for host in groups['connect'] | default([]) %} '{{ host }}-connect.{{ domain }}:{{ monitor_port_service }}', {% endfor %}