Permalink
Browse files

Add app_id in ULS response

Change-Id: Ica76169b389d9ab8b952f5ad9284d8eb97211f0c
  • Loading branch information...
anfernee committed Jul 31, 2012
1 parent ff5d2fa commit 8a3d41b5dc06a472d27f7cabe6f61c668075ac47
Showing with 7 additions and 2 deletions.
  1. +4 −1 ext/nginx/uls.lua
  2. +1 −0 lib/router/const.rb
  3. +2 −1 lib/router/router_uls_server.rb
View
@@ -28,6 +28,7 @@ ULS_STATS_LATENCY = "response_latency"
ULS_STATS_SAMPLES = "response_samples"
ULS_STATS_CODES = "response_codes"
ULS_STICKY_SESSION = "sticky_session"
+ULS_APP_ID = "app_id"
-- For both diretion
-- When ULS_BACKEND_ADDR sent from nginx to uls, it means sticky address
ULS_BACKEND_ADDR = "backend_addr"
@@ -67,7 +68,8 @@ ULS_ROUTER_IP = "router_ip"
{
"backend_addr": xxx,
"request_tags": xxx,
- "router_ip": xxx
+ "router_ip": xxx,
+ "app_id": xxx,
}
--]]
@@ -236,6 +238,7 @@ function post_process_subrequest(ngx, res)
ngx.var.uls_req_tags = msg[ULS_REQEST_TAGS]
ngx.var.router_ip = msg[ULS_ROUTER_IP]
ngx.var.sticky = msg[ULS_STICKY_SESSION]
+ ngx.var.app_id = msg[ULS_APP_ID]
ngx.log(ngx.DEBUG, "route "..ngx.var.http_host.." to "..ngx.var.backend_addr)
end
View
@@ -19,6 +19,7 @@
ULS_BACKEND_ADDR = :"backend_addr"
ULS_ROUTER_IP = :"router_ip"
ULS_STICKY_SESSION = :"sticky_session"
+ULS_APP_ID = :"app_id"
# Max Connections to Pool
MAX_POOL = 32
@@ -55,7 +55,8 @@ class ParserError < StandardError; end
ULS_STICKY_SESSION => new_sticky,
ULS_BACKEND_ADDR => "#{droplet[:host]}:#{droplet[:port]}",
ULS_REQUEST_TAGS => uls_req_tags,
- ULS_ROUTER_IP => Router.inet
+ ULS_ROUTER_IP => Router.inet,
+ ULS_APP_ID => droplet[:app] || 0,
}
end

2 comments on commit 8a3d41b

Hi ... I just found that "app_id" is missing in the nginx_router.conf file ...

http://reviews.cloudfoundry.org/#/c/8221/

Thanks!

Contributor

anfernee replied Aug 13, 2012

we also noticed that and submitted the same patch and merged it. thanks for the patch anyway! ;)

Please sign in to comment.