Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
2.0.0-alpha
-
Add a JSONP alternative outpout for /jmx HTTP interface to provide a Javascript polling ability in browsers.
-
jsonp metrics jmx
Description
JMXJsonServlet may provide a JSONP alternative to JSON to allow javascript in browser GUI to make requests.
For security purpose about XSS, browser limit request on other domain¹ so that metrics from cluster nodes cannot be used in a full js interface.
An example of this kind of dashboard is the bigdesk² plugin for ElasticSearch.
In order to achieve that the servlet should detect a GET parameter (callback=xxxx) and modify the response by surrounding the Json value with "xxxx(" and ");" ³
value "xxxx" is variable and should be provide by client as callback parameter value.
[1] https://developer.mozilla.org/en-US/docs/Same_origin_policy_for_JavaScript
[2] https://github.com/lukas-vlcek/bigdesk
[3] http://en.wikipedia.org/wiki/JSONP