From 658888bda8de6624892348c9e21c0ca725a83b49 Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Wed, 4 Sep 2024 01:56:37 -0500 Subject: [PATCH] Add prom metrics for plain http --- roles/prometheus/templates/prometheus.yml.j2 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/roles/prometheus/templates/prometheus.yml.j2 b/roles/prometheus/templates/prometheus.yml.j2 index 42d3a61..c4a1473 100644 --- a/roles/prometheus/templates/prometheus.yml.j2 +++ b/roles/prometheus/templates/prometheus.yml.j2 @@ -104,6 +104,25 @@ scrape_configs: {% endfor %} {% endfor %} + # This one does the same thing but for HTTP-only clients + - job_name: "generic-http" + scheme: "http" + static_configs: + - targets: +{% for host in groups['tags_nagios'] %} +{% set vars = hostvars[host] %} +{% for service in vars.services %} +{% for tag in service.tags %} +{# #} +{% if tag.slug == "prom-metrics-http" %} +{% for port in service.ports %} + - "{{ service.name }}:{{ port }}" +{% endfor %} +{% endif %} +{# #} +{% endfor %} +{% endfor %} +{% endfor %} # These two jobs are included for every node in our inventory - job_name: "node-exporter" static_configs: