VMware Cloud Community
ssroy
Contributor
Contributor

Problem in Monitoring Spring application

Hi,

I have a Spring application which I want to monitor using Hyperic. I can view the metrics using JBoss JMX-Console.

I have unjar "spring-plugin.jar" and modified the descriptor to add following.

<metric name="LastAccessTime"
alias="LastAccessTime"
template="statistics:name=monitorFactory:LastAccessTime"
category="THROUGHPUT"
indicator="true"
units="none"
collectionType="dynamic"/>

<metric name="TotalCallTime"
alias="TotalCallTime"
template="statistics:name=monitorFactory:TotalCallTime"
category="THROUGHPUT"
indicator="true"
units="none"
collectionType="dynamic"/>

<metric name="CallsCount"
alias="CallsCount"
template="statistics:name=monitorFactory:CallsCount"
category="THROUGHPUT"
indicator="true"
units="none"
collectionType="dynamic"/>

After deploying the updated JAR, I can see these metrics names from Hyperic admin screen.

But I cannot view the metrics for the deployed Spring WAR.

Can anyone please let me know what I am missing.

Any help will be greately appreciated.

I have deployed the spring-plugin.jar" both in server and agent.

Best Regards - Roy
0 Kudos
3 Replies
ssroy
Contributor
Contributor

Anyone please..
0 Kudos
ssroy
Contributor
Contributor

Hi,

Now I can see the service in JBoss.

I had to change the plugin as follows

<metric name="LastAccessTime"
alias="LastAccessTime"
template="spring.application:type=MonitorFactory:LastAccessTime"
indicator="true"
units="none"
collectionType="dynamic"/>

<metric name="TotalCallTime"
alias="TotalCallTime"
template="spring.application:type=MonitorFactory:TotalCallTime"
indicator="true"
units="none"
collectionType="dynamic"/>

<metric name="CallsCount"
alias="CallsCount"
template="spring.application:type=MonitorFactory:CallsCount"
indicator="true"
units="none"
collectionType="dynamic"/>

Spring applicationContext.xml

<bean class="org.springframework.jmx.export.MBeanExporter">
<property name="autodetect" value="true" />
<property name="beans">
<util:map>
<entry key="spring.application:type=MonitorFactory,name=SpringApp" value-ref="monitorFactory"/>
</util:map>
</property>
<property name="assembler">
<bean class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
<property name="interfaceMappings">
<util:map>
<entry key="spring.application:type=MonitorFactory,name=SpringApp"
value="com.x.monitor.GlobalMonitorStatistics"/>
</util:map>
</property>
</bean>
</property>
</bean>

Now the problem I am currently facing is:

1) Its shows only 'Availability' metrics with message "There are no indicator metrics data to display for time period between ..".

2) LastAccessTime, TotalCallTime, CallsCount metrics are not shown at all.

Can anyone please let me know what I am missing.

I am also attaching the source code.

Any help will be greately appreciated.

Best Regards - Roy
0 Kudos
ssroy
Contributor
Contributor

Anyone please..I am really struggling with this for last few days. Still its not working.

Best Regards - Roy
0 Kudos