Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-8922

Provide alternate JSONP output for JMXJsonServlet to allow javascript in browser dashboard

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: 2.0.3-alpha
    • Component/s: metrics
    • Labels:
    • Release Note:
      Add a JSONP alternative outpout for /jmx HTTP interface to provide a Javascript polling ability in browsers.
    • Tags:
      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

        Attachments

        1. test.html
          0.7 kB
          Damien Hardy
        2. HADOOP-8922-4-branch-2.patch
          5 kB
          Damien Hardy
        3. HADOOP-8922-3.patch
          4 kB
          Damien Hardy

          Activity

            People

            • Assignee:
              dam_ned Damien Hardy
              Reporter:
              dam_ned Damien Hardy
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: