Month: January 2017

23 Jan 2017

Using Stagemonitor with hybris

Stagemonitor is an opensource solution for performance monitoring of Java applications.It provides insights about the call stack ,Method execution time, page load time,JVM,JDBC, Request metrics and helps to better understand and improve the performance of applications.

Stagemonitor can be used for both development and production environments.It imposes a very low overhead on the application.

Stagemonitor for Development

hybris storefront with Stagemonitor widget

For development environments, Stagemonitor provides a widget which is injected into the webpage which is being monitored.This widget gives the details about the Call stack, time spent in each method,Web Requests and JVM metrics.

Stagemonitor widget-Call Tree tab

Call Tree tab provides the call stack and the time spent in each method.

Stagemonitor widget-Request tab

Request tab shows the total Page load time and also shows time taken for network,Server processing and DOM Processing.

Stagemonitor widget-Metrics tab

Metrics tab provides the details about the JDBC, JVM and Web Requests.


Stagemonitor can be configured to send the performance metrics to time series databases like ElasticSearch, Grafana.This allows the flexibility to monitor requests/metrics over a period of time and helps in understanding the application performance issues.

Multiple application instances running on different hosts can be monitored at a time using Stagemonitor.

Elasticsearch — JVM Metrics

Integrating with hybris

1. Download and install the below extension and add entry in the localextensions.xml . This extension contains all the dependencies and properties for running stagemonitor.

Stagemonitor hybris extension

2. The file at the below path is where the configuration can be controlled.

${HYBRIS_BIN_DIR}/bin/custom/stagemonitor/resources/, de.hybris = true

stagemonitor.applicationName=Electronics storefront
stagemonitor.instanceName=Electronics storefront


stagemonitor.instrument.jdbc.dataSource.implementations=com.mysql.jdbc.jdbc2.optional.MysqlDataSource, org.apache.tomcat.jdbc.pool.DataSource, org.apache.tomcat.dbcp.dbcp.PoolingDataSource, org.apache.tomcat.jdbc.pool.DataSourceProxy, org.apache.commons.dbcp2.PoolingDataSource, org.apache.commons.dbcp.PoolingDataSource, org.springframework.jdbc.datasource.AbstractDriverBasedDataSource, org.hsqldb.jdbc.jdbcDataSource, org.apache.commons.dbcp.BasicDataSource, de.hybris.platform.jdbcwrapper.HybrisDataSource

#stagemonitor.elasticsearch.url= http://localhost:9200

3. The tomcat general options property needs to be modified to include the below java agent.


4. Once hybris is restarted after the above changes, stagemonitor starts collecting the metrics and depending on the configuration, either the widget can be used from the browser or the the metrics can be sent to the Elasticsearch server for further analysis.