Merge "Managing show_image_direct_url variable"
diff --git a/glance/files/juno/glance-api.conf.Debian b/glance/files/juno/glance-api.conf.Debian
index 9dc67d4..f8e6c2c 100644
--- a/glance/files/juno/glance-api.conf.Debian
+++ b/glance/files/juno/glance-api.conf.Debian
@@ -498,7 +498,7 @@
 
 # Directory that the Filesystem backend store
 # writes image data to
-filesystem_store_datadir = /var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # A list of directories where image data can be stored.
 # This option may be specified multiple times for specifying multiple store
diff --git a/glance/files/juno/glance-cache.conf.Debian b/glance/files/juno/glance-cache.conf.Debian
index ab7a87f..0f88d1a 100644
--- a/glance/files/juno/glance-cache.conf.Debian
+++ b/glance/files/juno/glance-cache.conf.Debian
@@ -63,7 +63,7 @@
 
 # Directory that the Filesystem backend store
 # writes image data to
-filesystem_store_datadir = /var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # ============ Swift Store Options =============================
 
diff --git a/glance/files/kilo/glance-api.conf.Debian b/glance/files/kilo/glance-api.conf.Debian
index c11ba9d..e4f76d1 100644
--- a/glance/files/kilo/glance-api.conf.Debian
+++ b/glance/files/kilo/glance-api.conf.Debian
@@ -62,7 +62,7 @@
 # Allow access to version 2 of glance api
 #enable_v2_api = True
 
-filesystem_store_datadir=/var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # Return the URL that references where the data is stored on
 # the backend storage system.  For example, if using the
@@ -590,7 +590,7 @@
 
 # Directory that the Filesystem backend store
 # writes image data to
-filesystem_store_datadir = /var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # A list of directories where image data can be stored.
 # This option may be specified multiple times for specifying multiple store
diff --git a/glance/files/kilo/glance-cache.conf.Debian b/glance/files/kilo/glance-cache.conf.Debian
index c8c8f37..d233076 100644
--- a/glance/files/kilo/glance-cache.conf.Debian
+++ b/glance/files/kilo/glance-cache.conf.Debian
@@ -55,7 +55,7 @@
 
 # Directory that the Filesystem backend store
 # writes image data to
-filesystem_store_datadir = /var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # ============ Swift Store Options =============================
 
diff --git a/glance/files/liberty/glance-api.conf.Debian b/glance/files/liberty/glance-api.conf.Debian
index a81c55f..e29bce7 100644
--- a/glance/files/liberty/glance-api.conf.Debian
+++ b/glance/files/liberty/glance-api.conf.Debian
@@ -66,7 +66,7 @@
 # Allow access to version 2 of glance api
 #enable_v2_api = True
 
-filesystem_store_datadir=/var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # Return the URL that references where the data is stored on
 # the backend storage system.  For example, if using the
@@ -599,7 +599,7 @@
 
 # Directory that the Filesystem backend store
 # writes image data to
-filesystem_store_datadir = /var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # A list of directories where image data can be stored.
 # This option may be specified multiple times for specifying multiple store
diff --git a/glance/files/liberty/glance-cache.conf.Debian b/glance/files/liberty/glance-cache.conf.Debian
index c8c8f37..d233076 100644
--- a/glance/files/liberty/glance-cache.conf.Debian
+++ b/glance/files/liberty/glance-cache.conf.Debian
@@ -55,7 +55,7 @@
 
 # Directory that the Filesystem backend store
 # writes image data to
-filesystem_store_datadir = /var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # ============ Swift Store Options =============================
 
diff --git a/glance/files/mitaka/glance-api.conf.Debian b/glance/files/mitaka/glance-api.conf.Debian
index 5142013..b57b330 100644
--- a/glance/files/mitaka/glance-api.conf.Debian
+++ b/glance/files/mitaka/glance-api.conf.Debian
@@ -1150,7 +1150,7 @@
 # Directory to which the Filesystem backend store writes images.
 # (string value)
 #filesystem_store_datadir = /var/lib/glance/images
-filesystem_store_datadir=/var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 # List of directories and its priorities to which the Filesystem
 # backend store writes images. (multi valued)
diff --git a/glance/files/newton/glance-api.conf.Debian b/glance/files/newton/glance-api.conf.Debian
index 931fe44..dfa014e 100644
--- a/glance/files/newton/glance-api.conf.Debian
+++ b/glance/files/newton/glance-api.conf.Debian
@@ -2271,7 +2271,7 @@
 #
 #  (string value)
 #filesystem_store_datadir = /var/lib/glance/images
-filesystem_store_datadir=/var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 #
 # List of directories and their priorities to which the filesystem
diff --git a/glance/files/newton/glance-glare.conf.Debian b/glance/files/newton/glance-glare.conf.Debian
index f510066..f4b9931 100644
--- a/glance/files/newton/glance-glare.conf.Debian
+++ b/glance/files/newton/glance-glare.conf.Debian
@@ -1034,7 +1034,7 @@
 #
 #  (string value)
 #filesystem_store_datadir = /var/lib/glance/images
-filesystem_store_datadir=/var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 
 #
diff --git a/glance/files/newton/glance-registry.conf.Debian b/glance/files/newton/glance-registry.conf.Debian
index 6385f25..f736108 100644
--- a/glance/files/newton/glance-registry.conf.Debian
+++ b/glance/files/newton/glance-registry.conf.Debian
@@ -1149,7 +1149,7 @@
 #use_tpool = false
 
 [glance_store]
-filesystem_store_datadir = /var/lib/glance/images
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 swift_store_endpoint_type = {{ server.identity.get('endpoint_type', 'publicURL') }}
 
diff --git a/glance/files/ocata/glance-api.conf.Debian b/glance/files/ocata/glance-api.conf.Debian
index 7068951..48501e2 100644
--- a/glance/files/ocata/glance-api.conf.Debian
+++ b/glance/files/ocata/glance-api.conf.Debian
@@ -2337,7 +2337,7 @@
 #
 #  (string value)
 #filesystem_store_datadir = /var/lib/glance/images
-filesystem_store_datadir=/var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 #
 # List of directories and their priorities to which the filesystem
diff --git a/glance/files/ocata/glance-glare.conf.Debian b/glance/files/ocata/glance-glare.conf.Debian
index f510066..f4b9931 100644
--- a/glance/files/ocata/glance-glare.conf.Debian
+++ b/glance/files/ocata/glance-glare.conf.Debian
@@ -1034,7 +1034,7 @@
 #
 #  (string value)
 #filesystem_store_datadir = /var/lib/glance/images
-filesystem_store_datadir=/var/lib/glance/images/
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 
 #
diff --git a/glance/files/ocata/glance-registry.conf.Debian b/glance/files/ocata/glance-registry.conf.Debian
index 6385f25..f736108 100644
--- a/glance/files/ocata/glance-registry.conf.Debian
+++ b/glance/files/ocata/glance-registry.conf.Debian
@@ -1149,7 +1149,7 @@
 #use_tpool = false
 
 [glance_store]
-filesystem_store_datadir = /var/lib/glance/images
+filesystem_store_datadir = {{ server.get('filesystem_store_datadir', '/var/lib/glance/images/') }}
 
 swift_store_endpoint_type = {{ server.identity.get('endpoint_type', 'publicURL') }}
 
diff --git a/glance/meta/prometheus.yml b/glance/meta/prometheus.yml
index 4b1f8e1..7085f59 100644
--- a/glance/meta/prometheus.yml
+++ b/glance/meta/prometheus.yml
@@ -13,6 +13,16 @@
         summary: "Endpoint check for '{{ $labels.service }}' is down"
         description: >-
             Endpoint check for '{{ $labels.service }}' is down for 2 minutes
-{% endraw %}
+    GlanceErrorLogsTooHigh:
+{%- endraw %}
+      {%- set log_threshold = prometheus_server.get('alert', {}).get('GlanceErrorLogsTooHigh', {}).get('var', {}).get('threshold', 0.2 ) %}
+      if: >-
+        sum(rate(log_messages{service="cinder",level=~"error|emergency|fatal"}[5m])) without (level) > {{ log_threshold }}
+{%- raw %}
+      labels:
+        severity: warning
+        service: "{{ $labels.service }}"
+      annotations:
+        summary: 'Too many errors in {{ $labels.service }} logs'
+        description: 'The rate of errors in {{ $labels.service }} logs over the last 5 minutes is too high on node {{ $labels.host }} (current value={{ $value }}, threshold={%- endraw %}{{ log_threshold }}).'
 {%- endif %}
-
diff --git a/glance/meta/telegraf.yml b/glance/meta/telegraf.yml
index 11d6b0d..bdacc59 100644
--- a/glance/meta/telegraf.yml
+++ b/glance/meta/telegraf.yml
@@ -5,4 +5,5 @@
     http_response:
       glance-api:
         address: "http://{{ server.bind.address|replace('0.0.0.0', '127.0.0.1') }}:{{ server.bind.port }}/"
+        expected_code: 300
 {%- endif %}
\ No newline at end of file
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index 39ef63a..a711054 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -15,3 +15,5 @@
         enabled: true
       prometheus:
         enabled: true
+      telegraf:
+        enabled: true