Giter VIP home page Giter VIP logo

Comments (6)

ngzhian avatar ngzhian commented on August 25, 2024 1

There are two possible places we can translate the patterns to actual object names, when reading in the XML configuration (1), or just before publishing (2).

(1) will mean that the reading of XML depends on a MBeanServer. If we do this, we can make use of this dependency to discard bad configurations, e.g. MBeans that we cannot access, or do not exist

(2) will require us to do the checking of pattern names and testing the patterns again all available MBeans in the publish method, which seems to be beyond the responsibility of MBeanAttribute.

I will make a new branch to pursue (1) and see how it fares.

from jmxetric.

dpocock avatar dpocock commented on August 25, 2024

Confirmed

a) the code needs to be patched to detect when a pattern has been supplied

b) it also needs to detect when attributes come and go dynamically at runtime

from jmxetric.

ngzhian avatar ngzhian commented on August 25, 2024

When a pattern is specified in the configuration file, for example
<mbean name="*:type=Memory" pname="Memory">, which should match any domains, e.g. java.lang, or org.apache.karaf, how should we interpret this?
This seems to be logical: only the specified attributes of this mbean, which can be of ANY domain with type=Memory, for example:

<mbean name="*:type=Memory" pname="Memory">
  <attribute name="HeapMemoryUsage">
  <composite name="init" pname="Heap_init" type="int32" units="bytes"/>
  <composite name="committed" pname="Heap_committed" type="int32" units="bytes"/>
  <composite name="used" pname="Heap_used" type="int32" units="bytes" />
  <composite name="max" pname="Heap_max" type="int32" units="bytes" />
</attribute>
</mbean>

will match the attribute HeapMemoryUsage of ANY domain with type=Memory.

from jmxetric.

ngzhian avatar ngzhian commented on August 25, 2024

Object o = mbs.getAttribute(new ObjectName("*:type=Threading"), "ThreadCount"); just results in a InstanceNotFoundException being thrown. The way that JMXetric currently retrieves the values of MBeans is the same way,

Object o = mbs.getAttribute(objectName, attributeName);

This means that we cannot naively use the pattern ObjectName.

One way to do this is to list all MBeans using queryMBeans passing in null arguments, as described here, and doing a check if the names matches using the apply method

from jmxetric.

dpocock avatar dpocock commented on August 25, 2024

There is one further aspect to this - we probably need to support regex "groups" in the pattern and then extract the string in the group and use it to create the metric names sent to Ganglia.

from jmxetric.

ngzhian avatar ngzhian commented on August 25, 2024

One way of doing so is (in pseudo code)

if ObjectName contains pattern
  loop through all available mbeans
    if mbean matches this ObjectName
      add to the MBeanSampler with specific MBean name (no patterns)
else
  add to MBeanSampler

from jmxetric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.