Enable API status monitoring

Change-Id: Icd27849382b1ff1f63f8c8119f7861083ce498b0
Depends-On: Icdc01625730d0385e020c550757212f6be5c6fb4
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index ea701e1..fce5030 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -11,3 +11,5 @@
         enabled: false
       prometheus:
         enabled: true
+      telegraf:
+        enabled: true
diff --git a/octavia/meta/prometheus.yml b/octavia/meta/prometheus.yml
index b75fd3a..dcde1d1 100644
--- a/octavia/meta/prometheus.yml
+++ b/octavia/meta/prometheus.yml
@@ -3,6 +3,19 @@
 {%- if api.get('enabled', False) %}
 server:
   alert:
+{%- raw %}
+    OctaviaAPIDown:
+      if: >-
+        max(openstack_api_check_status{service="octavia-api"}) == 0
+      for: 2m
+      labels:
+        severity: down
+        service: "{{ $labels.service }}"
+      annotations:
+        summary: "Endpoint check for '{{ $labels.service}}' is down"
+        description: >-
+            Endpoint check for '{{ $labels.service}}' is down for 2 minutes
+{%- endraw %}
     OctaviaErrorLogsTooHigh:
       {%- set log_threshold = monitoring.error_log_rate|float %}
       if: >-
diff --git a/octavia/meta/telegraf.yml b/octavia/meta/telegraf.yml
new file mode 100644
index 0000000..2af7d05
--- /dev/null
+++ b/octavia/meta/telegraf.yml
@@ -0,0 +1,9 @@
+{%- from "octavia/map.jinja" import api with context %}
+{%- if api.get('enabled', False) %}
+agent:
+  input:
+    http_response:
+      octavia-api:
+        address: "http://{{ api.bind.address|replace('0.0.0.0', '127.0.0.1') }}:{{ api.bind.port }}/"
+        expected_code: 200
+{%- endif %}