{"record":{"id":"172c484bac874986","repo":"apache/cassandra","slug":"no-readable-value-attribute-for-cql-metric","errorCode":null,"errorMessage":"No readable value attribute for CQL metric: ","messagePattern":"No readable value attribute for CQL metric: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":1965,"sourceCode":"    }\n\n    /**\n     * Retrieve a CQL metric value by name. Works generically for any metric registered under\n     * {@code org.apache.cassandra.metrics:type=CQL,name=<metricName>} by inspecting the MBean\n     * attributes at runtime, without requiring knowledge of the underlying metric type.\n     */\n    public Object getCQLMetric(String metricName)\n    {\n        try\n        {\n            ObjectName objectName = new ObjectName(DefaultNameFactory.GROUP_NAME + \":type=\" + CQLMetrics.TYPE_NAME + \",name=\" + metricName);\n            for (MBeanAttributeInfo attr : mbeanServerConn.getMBeanInfo(objectName).getAttributes())\n            {\n                String name = attr.getName();\n                if (\"Value\".equals(name) || \"Count\".equals(name))\n                    return mbeanServerConn.getAttribute(objectName, name);\n            }\n            throw new RuntimeException(\"No readable value attribute for CQL metric: \" + metricName);\n        }\n        catch (MalformedObjectNameException | InstanceNotFoundException | IntrospectionException |\n               ReflectionException | AttributeNotFoundException | MBeanException | IOException e)\n        {\n            throw new RuntimeException(e);\n        }\n    }\n\n    private static Multimap<String, String> getJmxThreadPools(MBeanServerConnection mbeanServerConn)\n    {\n        try\n        {\n            Multimap<String, String> threadPools = HashMultimap.create();\n\n            Set<ObjectName> threadPoolObjectNames = mbeanServerConn.queryNames(\n                    new ObjectName(\"org.apache.cassandra.metrics:type=ThreadPools,*\"),\n                    null);\n","sourceCodeStart":1947,"sourceCodeEnd":1983,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L1947-L1983","documentation":"RuntimeException thrown by NodeProbe.getCQLMetric when no readable value attribute is found on the CQL metrics MBean for the given metric name. The MBean exists under org.apache.cassandra.metrics:type=CQL but exposes no attribute the code can read a value from — the metric name is wrong or the metric type exposes no scalar attribute.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/tools/NodeProbe.java:1965 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the exact metric name with nodetool or JConsole under org.apache.cassandra.metrics:type=CQL","Use a metric name that maps to a gauge/counter attribute","Handle the returned exception in nodetool callers by validating metric names first"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}