fix: adding octopus_exporter compose

This commit is contained in:
Rasmus Wejlgaard 2026-04-25 12:29:24 +01:00
parent 56bec98afc
commit 5cc2a4ef0f
3 changed files with 23 additions and 1 deletions

View file

@ -3,3 +3,6 @@ host_role: idle
host_description: "Idle/available"
host_location: "London"
prometheus_location: london
docker_services:
- octopus-exporter

View file

@ -0,0 +1,11 @@
---
# octopus-exporter - Octopus Energy metrics for Prometheus
# Host: london-c (100.123.72.87)
services:
octopus-exporter:
image: rwejlgaard/octopus_exporter:v1.1.0
container_name: octopus_exporter
restart: unless-stopped
ports:
- "9359:9359"

View file

@ -22,7 +22,15 @@ scrape_configs:
- job_name: "octopus_exporter"
static_configs:
- targets: ["100.123.72.87:9359"]
{% for host in groups['all'] | sort %}
{% set h = hostvars[host] %}
{% if 'octopus-exporter' in (h.docker_services | default([])) %}
- targets: ["{{ h.ansible_host }}:9359"]
labels:
location: {{ h.prometheus_location }}
server: {{ host }}
{% endif %}
{% endfor %}
- job_name: "node_exporter"
static_configs: