Add Alertmanager prometheus endpoint and replace ports with variables

Change-Id: I55867b8e483e48204d6393a3542f254556262905
diff --git a/docker/swarm/service/monitoring/prometheus_alertmanager.yml b/docker/swarm/service/monitoring/prometheus_alertmanager.yml
index 5d5f237..942fa42 100644
--- a/docker/swarm/service/monitoring/prometheus_alertmanager.yml
+++ b/docker/swarm/service/monitoring/prometheus_alertmanager.yml
@@ -1,4 +1,4 @@
-include:
+classes:
 - service.prometheus.alertmanager.container
 parameters:
   docker:
diff --git a/docker/swarm/service/monitoring/prometheus_pushgateway.yml b/docker/swarm/service/monitoring/prometheus_pushgateway.yml
index ad159b6..850f66e 100644
--- a/docker/swarm/service/monitoring/prometheus_pushgateway.yml
+++ b/docker/swarm/service/monitoring/prometheus_pushgateway.yml
@@ -1,3 +1,5 @@
+classes:
+- service.prometheus.pushgateway.container
 parameters:
   docker:
     client:
@@ -5,8 +7,11 @@
         prometheus_pushgateway:
           network: monitoring
           replicas: 2
+          environment:
+            bind_port: ${prometheus:pushgateway:bind:port}
+            bind_address: ${prometheus:pushgateway:bind:address}
           restart:
             condition: any
           image: ${_param:docker_image_pushgateway}
           ports:
-            - 15012:9091
+            - 15012:${prometheus:pushgateway:bind:port}
diff --git a/docker/swarm/service/monitoring/prometheus_server.yml b/docker/swarm/service/monitoring/prometheus_server.yml
index 37bb6d3..5c0a480 100644
--- a/docker/swarm/service/monitoring/prometheus_server.yml
+++ b/docker/swarm/service/monitoring/prometheus_server.yml
@@ -1,4 +1,4 @@
-include:
+classes:
 - service.prometheus.server.container
 parameters:
   docker:
diff --git a/docker/swarm/stack/monitoring.yml b/docker/swarm/stack/monitoring.yml
index 46a2845..bbc2d24 100644
--- a/docker/swarm/stack/monitoring.yml
+++ b/docker/swarm/stack/monitoring.yml
@@ -37,9 +37,12 @@
                 replicas: 2
                 restart_policy:
                   condition: any
+              environment:
+                bind_port: ${prometheus:pushgateway:bind:port}
+                bind_address: ${prometheus:pushgateway:bind:address}
               image: ${_param:docker_image_pushgateway}
               ports:
-                - 15012:9091
+                - 15012:${prometheus:pushgateway:bind:port}
             server:
               networks:
                 - monitoring
diff --git a/prometheus/server/target/dns.yml b/prometheus/server/target/dns.yml
index fd56d1d..14d5da3 100644
--- a/prometheus/server/target/dns.yml
+++ b/prometheus/server/target/dns.yml
@@ -1,3 +1,7 @@
+classes:
+- service.prometheus.server.container
+- service.prometheus.alertmanager.container
+- service.prometheus.pushgateway.container
 parameters:
   prometheus:
     server:
@@ -9,9 +13,14 @@
               domain:
               - 'tasks.monitoring_pushgateway'
               type: A
-              port: 9091
+              port: ${prometheus:pushgateway:bind:port}
             - name: 'prometheus'
               domain:
               - 'tasks.monitoring_server'
               type: A
-              port: 9090
+              port: ${prometheus:server:bind:port}
+            - name: 'alertmanager'
+              domain:
+              - 'tasks.monitoring_alertmanager'
+              type: A
+              port: ${prometheus:alertmanager:bind:port}