]> git.openstreetmap.org Git - chef.git/commitdiff
Add a request ID to connect frontend and backend logs
authorTom Hughes <tom@compton.nu>
Fri, 17 Jul 2015 18:27:57 +0000 (19:27 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 17 Jul 2015 18:27:57 +0000 (19:27 +0100)
cookbooks/web/recipes/backend.rb
cookbooks/web/recipes/frontend.rb
cookbooks/web/templates/default/apache.backend.erb
cookbooks/web/templates/default/apache.frontend.erb

index 6f86f2064be94e066f02304eaf7d4a1a74459617..ae359ca472d86d51ccc6df056cad1d180f6bdeab 100644 (file)
@@ -28,6 +28,7 @@ apache_module "remoteip"
 apache_module "rewrite"
 apache_module "proxy"
 apache_module "proxy_fcgi"
+apache_module "setenvif"
 
 apache_site "default" do
   action [:disable]
index 6f62f31865baa04d93e7ca5828375e5cfd83b911..1be89358c4b874830ead201b4fca95c88ca12e77 100644 (file)
@@ -31,6 +31,7 @@ apache_module "proxy_balancer"
 apache_module "lbmethod_byrequests"
 apache_module "lbmethod_bybusyness"
 apache_module "rewrite"
+apache_module "unique_id"
 
 apache_site "default" do
   action [:disable]
index d6dc4cd396460d05390eab93d0e36d8568cbaf43..4380f5ca7b8e6ac0d38c7e631e411955e5097ddd 100644 (file)
   #
   RewriteEngine on
 
+  #
+  # Recover the unique ID from the request headers
+  #
+  SetEnvIf X-Request-Id ^(.*)$ UNIQUE_ID=$1
+
   #
   # Configure rails
   #
index 5177f89eb21af8ff1c82a49da92f5457aded034b..d0260be3dcdfba512676dfbc4419e60e71c7ba02 100644 (file)
   ExpiresActive On
   RewriteEngine on
 
+  #
+  # Add the unique ID to the request headers
+  #
+  RequestHeader set X-Request-Id %{UNIQUE_ID}e
+
   #
   # Block troublesome GPX data scrapping
   #