Comments (6)
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.
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.
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.
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.
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.
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)
- write a utility to scan the MBean server and generate sample configuration entries HOT 4
- the value of TMAX in the gmond output XML is always 60, no matter what delay is configured
- need a way to specify DMAX HOT 3
- Using slope=positive does not work for gmond 3.0.x
- support for including configuration from multiple files HOT 2
- better CPU metric support HOT 7
- reloading jmxetric XML configuration at runtime HOT 3
- Private MyPublisher class in MBeanSamplerTest.java does not implement all methods of Publisher interface
- JMXetricAgentIT fails with NumberFormatException HOT 3
- Standardize formatting for source files HOT 1
- jmxetric 1.0.6 fails to honor <ganglia> element in xml config
- Feature request: Read ganglia configuration from gmond.conf, or allow multiple <ganglia> config elements to be specified
- Can't monitor webapp's JVM in JBoss EAP 6.2 (Domain mode) HOT 2
- configuration of jmx
- should not initialise logging when loaded early, breaks other logging systems HOT 2
- support for deriving rates from counters HOT 1
- delayed mbean initialisation HOT 1
- Scaling metrics
- calls ManagementFactory.getPlatformMBeanServer too early HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmxetric.