Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to java.lang.Object attributes #137

Open
jskyworker opened this issue Apr 21, 2017 · 1 comment
Open

Access to java.lang.Object attributes #137

jskyworker opened this issue Apr 21, 2017 · 1 comment

Comments

@jskyworker
Copy link

I hit the same issue as #118
No errors an no data:

$>bean org.springframework.boot:name=metricsEndpoint,type=Endpoint
#bean is set to org.springframework.boot:name=metricsEndpoint,type=Endpoint
$>info
#mbean = org.springframework.boot:name=metricsEndpoint,type=Endpoint
#class name = org.springframework.boot.actuate.endpoint.jmx.DataEndpointMBean

attributes

%0 - Data (java.lang.Object, r)
%1 - EndpointClass (java.lang.String, r)
%2 - Sensitive (boolean, r)

operations

%0 - java.lang.Object getData()
%1 - java.lang.String getEndpointClass()
%2 - boolean isSensitive()
#there's no notifications
$>get Data
#mbean = org.springframework.boot:name=metricsEndpoint,type=Endpoint:
Data = {
mem = 893013;
mem.free = 590049;
processors = 4;
instance.uptime = 181587;
uptime = 201589;
systemload.average = 1.78955078125;
heap.committed = 798720;
heap.init = 131072;
heap.used = 208670;
heap = 1864192;
nonheap.committed = 96664;
nonheap.init = 2496;
nonheap.used = 94293;
nonheap = 0;
threads.peak = 24;
threads.daemon = 22;
threads.totalStarted = 31;
threads = 24;
classes = 12646;
classes.loaded = 12646;
classes.unloaded = 0;
gc.ps_scavenge.count = 16;
gc.ps_scavenge.time = 301;
gc.ps_marksweep.count = 3;
gc.ps_marksweep.time = 424;
httpsessions.max = -1;
httpsessions.active = 0;
datasource.primary.active = 0;
datasource.primary.usage = 0.0;
};

$>get Data.mem
#mbean = org.springframework.boot:name=metricsEndpoint,type=Endpoint:

How can i get metrics inside Data structure? Any help are welcome.
Thanks.

@tinexw
Copy link
Contributor

tinexw commented Jul 22, 2017

I faced the same problem. The issue is that spring boot declares the type of the Data attribute as Object. This is considered a simple type by jmxfetch and thus the entries of the map are not resolved. I solved it by creating my own JMX endpoints in spring boot similar to the existing ones but with a Map return type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants