Add auto-discovery for prometheus
Change-Id: I093127fc398dd14b2c2593615a03828e629b5fb2
diff --git a/etcd/meta/prometheus.yml b/etcd/meta/prometheus.yml
index f2f2d8e..cadb071 100644
--- a/etcd/meta/prometheus.yml
+++ b/etcd/meta/prometheus.yml
@@ -1,5 +1,17 @@
-{% raw %}
+{%- from "etcd/map.jinja" import server with context %}
server:
+ target:
+ static:
+ etcd:
+ endpoint:
+ {%- set hostname = grains.get('nodename') %}
+ {%- for member in server.members %}
+ {%- if member.name == hostname %}
+ - address: {{ member.host }}
+ port: {{ member.port }}
+ {%- endif %}
+ {%- endfor %}
+{% raw %}
alert:
EtcdFailedTotalIn5m:
if: >-