newrelic / nri-cassandra

New Relic Infrastructure Cassandra Integration
Apache License 2.0
6 stars 18 forks source link

Fix native transport metrics #165

Closed idleyoungman closed 9 months ago

idleyoungman commented 1 year ago

The native transport metrics MBeans for ActiveTasks, CompletedTasks, and PendingTasks have a attribute named "Value" instead of "Count". This change updates the MBeanAttribute names to match the actual attribute names. The NTR metrics were added in #117.

Counter-type threadpool metrics use the attribute name "Count", while Gauge<Integer>-type threadpool metrics use the attribute name "Value":

See the JMX test data from apache/cassandra. Note the file is too large to view in GitHub. https://github.com/apache/cassandra/blob/trunk/test/data/jmxdump/cassandra-4.0-jmx.yaml

From a local Cassandra checkout:

❯ grep -A2 ',path=transport,scope=Native-Transport-Requests' test/data/jmxdump/cassandra-4.0-jmx.yaml
org.apache.cassandra.metrics:type=ThreadPools,path=transport,scope=Native-Transport-Requests,name=ActiveTasks:
  attributes:
  - {access: read-only, name: Value, type: java.lang.Object}
--
org.apache.cassandra.metrics:type=ThreadPools,path=transport,scope=Native-Transport-Requests,name=CompletedTasks:
  attributes:
  - {access: read-only, name: Value, type: java.lang.Object}
--
org.apache.cassandra.metrics:type=ThreadPools,path=transport,scope=Native-Transport-Requests,name=CurrentlyBlockedTasks:
  attributes:
  - {access: read-only, name: Count, type: long}
--
org.apache.cassandra.metrics:type=ThreadPools,path=transport,scope=Native-Transport-Requests,name=MaxPoolSize:
  attributes:
  - {access: read-only, name: Value, type: java.lang.Object}
--
org.apache.cassandra.metrics:type=ThreadPools,path=transport,scope=Native-Transport-Requests,name=MaxTasksQueued:
  attributes:
  - {access: read-only, name: Value, type: java.lang.Object}
--
org.apache.cassandra.metrics:type=ThreadPools,path=transport,scope=Native-Transport-Requests,name=PendingTasks:
  attributes:
  - {access: read-only, name: Value, type: java.lang.Object}
--
org.apache.cassandra.metrics:type=ThreadPools,path=transport,scope=Native-Transport-Requests,name=TotalBlockedTasks:
  attributes:
  - {access: read-only, name: Count, type: long}
gsanchezgavier commented 9 months ago

~@idleyoungman could you add an entry to the unreleased section of the changelog so this fix gets automatically released by the CI? Thanks~ I'll do it since there are some extra chores I will take care before releasing