summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/register/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2023-12-03 05:23:28 +0100
committerChristian Pointner <equinox@spreadspace.org>2023-12-03 05:23:28 +0100
commit73d220d72d491fff4e8f9206491af6bb2ca5a056 (patch)
treef1ff9517d69d1182c01309a385aa2a7bc0f999c2 /roles/monitoring/prometheus/exporter/register/templates
parentfixup! ch-http-proxy: acutally enable the nftables role for this host (diff)
add whawty-nginx-sso to prometheus monitoring
Diffstat (limited to 'roles/monitoring/prometheus/exporter/register/templates')
-rw-r--r--roles/monitoring/prometheus/exporter/register/templates/blackbox/probe.yml.j23
-rw-r--r--roles/monitoring/prometheus/exporter/register/templates/whawty-nginx-sso.yml.j27
2 files changed, 10 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/exporter/register/templates/blackbox/probe.yml.j2 b/roles/monitoring/prometheus/exporter/register/templates/blackbox/probe.yml.j2
index 3ecf129a..5f98e3a8 100644
--- a/roles/monitoring/prometheus/exporter/register/templates/blackbox/probe.yml.j2
+++ b/roles/monitoring/prometheus/exporter/register/templates/blackbox/probe.yml.j2
@@ -3,6 +3,9 @@
instance: '{{ target.instance }}'
__param_target: '{{ target.config.target }}'
__param_module: '{{ target.config.module }}'
+{% if 'hostname' in target.config %}
+ __param_hostname: '{{ target.config.hostname }}'
+{% endif %}
{% for name, value in prometheus_target_labels.items() %}
{{ name }}: '{{ value }}'
{% endfor %}
diff --git a/roles/monitoring/prometheus/exporter/register/templates/whawty-nginx-sso.yml.j2 b/roles/monitoring/prometheus/exporter/register/templates/whawty-nginx-sso.yml.j2
new file mode 100644
index 00000000..74ada64e
--- /dev/null
+++ b/roles/monitoring/prometheus/exporter/register/templates/whawty-nginx-sso.yml.j2
@@ -0,0 +1,7 @@
+- targets: [ '{{ (target.exporter_hostname == prometheus_server) | ternary('127.0.0.1:9999', hostvars[target.exporter_hostname].prometheus_scrape_endpoint) }}' ]
+ labels:
+ instance: '{{ target.instance }}'
+ __metrics_path__: '/whawty-nginx-sso/{{ target.config.instance_name }}'
+{% for name, value in prometheus_target_labels.items() %}
+ {{ name }}: '{{ value }}'
+{% endfor %}