Solr
  1. Solr
  2. SOLR-3083

all JMX Mbeans are identified as java.lang.String even if numeric

    Details

      Description

      When trying to monitor our Solr instances with JMXtrans (https://github.com/lookfirst/jmxtrans), we discovered that all the Mbeans were identifying themselves as java.lang.String. This breaks the GangliaWriter in JMXtrans because the software decides it's a string instead of a numeric values and you can't graph a string. Other software we are monitoring with JMXtrans (e.g. Kafka) correctly identify their numeric values as numbers (doubles in this case).

      For example, avgTimePerRequest in Solr is identified as a string which makes no sense. This behavior makes Solr less interoperable with the rest of the Java ecosystem.

      The problem code is in JmxMonitoredMap.java

      NamedList dynamicStats = infoBean.getStatistics();
      if (dynamicStats != null) {
      for (int i = 0; i < dynamicStats.size(); i++)

      { String name = dynamicStats.getName(i); if (!staticStats.contains(name)) attrInfoList.add(new MBeanAttributeInfo(dynamicStats.getName(i), String.class.getName(), null, true, false, false)); }

      I will try to attach a screenshot.

      Thanks for Solr! We use the heck out of it, it's awesome.

        Activity

        Hide
        Tagged Siteops added a comment -

        Screenshot showing all beans as strings despite being obviously numeric.

        Show
        Tagged Siteops added a comment - Screenshot showing all beans as strings despite being obviously numeric.
        Hide
        Greg Bowyer added a comment -

        Attempt to make numeric mbeans turn into numeric types from the viewpoint of JMX

        Show
        Greg Bowyer added a comment - Attempt to make numeric mbeans turn into numeric types from the viewpoint of JMX
        Hide
        Ryan McKinley added a comment -

        added in r1335147

        thanks for the test cases!

        Show
        Ryan McKinley added a comment - added in r1335147 thanks for the test cases!
        Hide
        Ryan Josal added a comment -

        I applied this patch to Solr 3.6 - I noticed it missed the "hitratio" mbean attribute from [Fast]LRUCache. Looks like that attribute is actually calculated into a String and so would have to be fixed by itself. I'm not sure if this is still present in the latest builds though.

        Show
        Ryan Josal added a comment - I applied this patch to Solr 3.6 - I noticed it missed the "hitratio" mbean attribute from [Fast] LRUCache. Looks like that attribute is actually calculated into a String and so would have to be fixed by itself. I'm not sure if this is still present in the latest builds though.

          People

          • Assignee:
            Ryan McKinley
            Reporter:
            Tagged Siteops
          • Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development