Bug 52264 - Update and complete balancer-manager XML output
Summary: Update and complete balancer-manager XML output
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_balancer (show other bugs)
Version: 2.4-HEAD
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-30 19:51 UTC by Jim Riggs
Modified: 2011-11-30 19:55 UTC (History)
0 users



Attachments
Full patch (27.92 KB, patch)
2011-11-30 19:51 UTC, Jim Riggs
Details | Diff
Patch ignoring whitespace for those who want to take a quick look (11.58 KB, patch)
2011-11-30 19:52 UTC, Jim Riggs
Details | Diff
Sample full output (?xml) (7.70 KB, application/xml)
2011-11-30 19:54 UTC, Jim Riggs
Details
Sample specified balancer output (?xml&b=...) (3.92 KB, application/xml)
2011-11-30 19:55 UTC, Jim Riggs
Details
Sample specified balancer and worker output (?xml&b=...&w=...) (2.37 KB, application/xml)
2011-11-30 19:55 UTC, Jim Riggs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Riggs 2011-11-30 19:51:42 UTC
Created attachment 28004 [details]
Full patch

As discussed in http://www.mail-archive.com/dev%40httpd.apache.org/msg53026.html, here is a 2.4 patch that provides more complete XML output for balancer-manager. I have been using a 2.2 version of this patch in production for probably 2.5 years or more now. Having more complete XML output allows for much better/simpler automated monitoring of mod_proxy balancers.

What it does:

* Removes the nonce requirement for XML output (which is read-only anyway).
* Provides all (useful) fields of the proxy_balancer_shared struct.
* Provides all (useful) fields of the proxy_worker_shared struct.
* Can limit the output to a specific balancer (bsel) and worker (wsel) via the same b and w params used by html. This is useful for monitoring.

Notes:

* I tried to use the configuration names for the struct fields in the XML (e.g. stickysession vs. sticky, nofailover vs. sticky_force).
* I tried to output the configuration units for the struct fields in the XML (e.g. seconds vs. microseconds for timeout).
* I'm not sure what people will think of the code style, but the big ap_rprintf() calls seemed to give the most readable code.
* Can anyone find a better way to create the worker status field string?
* Admittedly, I'm not sure what all of the struct fields are, so it may not make sense to include all of them. I cut some out, but what about others (e.g. flusher, is_address_reusable)?
Comment 1 Jim Riggs 2011-11-30 19:52:42 UTC
Created attachment 28005 [details]
Patch ignoring whitespace for those who want to take a quick look
Comment 2 Jim Riggs 2011-11-30 19:54:22 UTC
Created attachment 28006 [details]
Sample full output (?xml)
Comment 3 Jim Riggs 2011-11-30 19:55:02 UTC
Created attachment 28007 [details]
Sample specified balancer output (?xml&b=...)
Comment 4 Jim Riggs 2011-11-30 19:55:33 UTC
Created attachment 28008 [details]
Sample specified balancer and worker output (?xml&b=...&w=...)