JavaMelody Monitoring

Emeric Vernat
Data Modeling & Business Logic
Monitoring of a Liferay server with JavaMelody
Online demo: https://github.com/javamelody/javamelody/wiki/Demo
To install or upgrade:
Liferay is trademark of Liferay, Inc., Liferay International Limited and/or Liferay Affiliate, registered in the United States and/or other countries.
    All prices displayed are in USD. For pricing specific to your country/currency, please follow the installation instructions below for accessing and purchasing this app through your Control Panel.
    Release Summary and Release Notes
    Version Change Log Supported Framework Versions Date Added
    1.91.0 * fix connections_used_count in metrics for Prometheus (thanks to Michele Preti). * fix Incorrect "used jdbc connections" when using Spring JdbcTemplate.queryForStream * fix Prometheus endpoint returns empty response when working with SpringBoot (thanks to Goldy (Gordon)) * fix database report not working with recent H2
    Liferay Portal 6.1 CE GA3+
    1.90.0 upgrade Log4j 2 to 2.16.0 in the optional javamelody collect server for CVE-2021-44228 and CVE-2021-45046. fix Hibernate criteria query naming (PR 1049, thanks to Fabio) fix #933 Http sessions with changed ids are removed from sessions page when one of them terminates (PR 934, thanks to lmalmeida) remove defaultAutoCommit attribute from datasource example for the Liferay plugin (#10). added support for Eclipse OpenJ9 JVM heap dump externalize some css and js (thanks to Craig Andrews) work towards Content-Security-Policy (thanks to Craig Andrews + fixes) added to enhance security, Content-Security-Policy is now enabled by default in the monitoring page. The parameter content-security-policy-enabled can be set to false to disable it. (thanks to Craig Andrews) updated Chinese traditional (Taïwan) translations, (language "zh-TW", thanks to Jack)
    Liferay Portal 6.1 CE GA3+
    1.87.0 - fix html page truncated when using Real User Monitoring with the javamelody parameter rum-enabled and when the content length of the reponse is set (PR 964, thanks to Craig Andrews). - added thousand separator for numbers in the MBeans report (PR 979, thanks to Fabio Boldrini). - added new javamelody parameter datadog-api-host for specifying Datadog base API host such as api.datadoghq.eu (api.datadoghq.com by default, see doc, PR 971, thanks to Michal Kebrt). - added new javamelody parameter statsd-prefix for the prefix of the metric names in StatsD (javamelody.context.host. by default and where context and host gets replaced by the actual values, see doc, PR 970, thanks to Michal Kebrt). - added Dutch translations (language "nl", 1972369, thanks to Joris) - added Chinese traditional (Taïwan) translations, (language "zh-TW", 63dd373, thanks to Jack) - updated Czech translations, (language "cs", 4cee901, thanks to Kamil Steinbach) - To contribute in your own language, join the translation project at https://poeditor.com/join/project/QIaCp4bThS.
    Liferay Portal 6.1 CE GA3+
    1.86.0 - fix #936 heap histo report missing with OpenJDK from third party providers. - fix #943 incorrect Italian translation (thanks to massimosala). To contribute in your own language, join the translation project at https://poeditor.com/join/project/QIaCp4bThS.
    Liferay Portal 6.1 CE GA3+
    1.85.0 - fix heap histo report failed with an early access version of the jdk, such as 15-ea. - fix Monitoring a jdbc DataSource in WebLogic Server - added monitoring of Mongodb from the new Spring's MongoDatabaseFactory like from MongoDbFactory
    Liferay Portal 6.1 CE GA3+
    1.83.0 - fixed: allow JDBC monitoring in Tomcat in an OSGi environment (Liferay 7+), thanks to Adrian Rodriguez. - improved: If there are http or sql requests with many dynamic values like "/get/entity/10" or "select * from table where id in (123, 456)" (dynamic values in sql without binded parameters), you should already use the javamelody parameters http-transform-pattern or sql-transform-pattern, in order to limit disk IO and disk space usage for the statistics and RRD graphs. If you forget that, some RRD files will now be automatically deleted everyday at midnight to limit the disk space used by RRD files under 20 MB. You may configure that limit with the javamelody parameter max-rrd-disk-usage-mb (20 by default). And old statistics and graphs are automatically deleted like before. - improved: Database report on locks for Postgresql 9.2+ - added: display sources of Tomcat's classes from stack-traces like for the webapp's dependencies - added: As an external API, dump of graphs values as XML or as TXT, for the choosen period or for all periods, with links to Last value, Dump XML, Dump TXT below the zoomed graphics
    Liferay Portal 6.1 CE GA3+
    1.82.0 - fix GSON format should not depend on XStream. - improved: in the http sessions, identify the new MS Edge browser as Edg instead of Chrome. - optimized: when displaying the report, lazy load images in "Other charts". - clarify that statistics in reports starts at midnight (in the server's time zone), for example "1 day since midnight".
    Liferay Portal 6.1 CE GA3+
    1.81.0 fix #869, PersistenceException: No Persistence provider for EntityManager, with Hibernate 5.4 and JPA. And now, the JPA monitoring is always enabled when using JPA 2 directly, even if <provider>net.bull.javamelody.JpaPersistence</provider> is not added in persistence.xml. fix #871, thanks to Vicente Rossello Jaume: In the optional collect server, each current request already displayed once is not displayed anymore after refresh. fix #876, StopWatch not displayed in statistics by default. fix #884, CircularReferenceException in External API with JSON for current requests. added: sessionId attribute in the current requests for the External API. (PR 873, thanks to Eugene Kortov) added: graph of Usable disk space next to Free disk space in "Other charts" (the usable disk space may be lower than the free disk space, #875).
    Liferay Portal 6.1 CE GA3+
    1.79.0 JavaMelody real case: Investigation of a large Liferay web site with intermittent slowdowns: https://github.com/javamelody/javamelody/wiki/RealCase1 fix: when no content in the http response, MonitoringFilter should not flush buffer, since 1.78.0. fix: Tomcat info is not available anymore since Tomcat 8.5.35 and Tomcat 9.0.13. fix: When downloading more than 2GB, assertionError may occur. fix: for a JSR107 jcache, the clear button and the link to cache keys are now unavaliable, when the cache was created from a CacheManager initialized by an URI. added: monitor mongodb collections automatically, when using spring-boot-data-mongodb or when MongoDbFactory is in Spring's context.
    Liferay Portal 6.1 CE GA2+
    1.78.0 - added: display an alert at the top of the monitoring page when there is an exception while collecting data, in order to make easier to fix basic technical issues in javamelody. For example, IOException: No space left on device. - fix to still flush the response when no content in FilterServletResponseWrapper.flushBuffer() - fix the database reports for MariaDb - added: Czech translations (thanks to Lukáš Karabec) - improved: missing German translations (thanks to Michael Dobrovnik) - To contribute in your own language, join the translation project at https://poeditor.com/join/project/QIaCp4bThS.
    Liferay Portal 6.1 CE GA2+
    1.77.0 - added: ability to upload heap dump files to AWS S3 (thanks to Salah Qasem). See doc: https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#upload-heap-dumps-to-aws-s3 - added: in the database reports, added support for MariaDB (thanks to Vicente Rossello Jaume). - added: Italian translations (thanks to Gianluca Maiorino) - added: Ukrainian translations (thanks to Yevgen Lasman) - To contribute in your own language, join the translation project at https://poeditor.com/join/project/QIaCp4bThS
    Liferay Portal 6.1 CE GA2+
    1.76.0 - You can now contribute translations for javamelody by using a dedicated website at POEditor. You may contribute some "untranslated" labels for German and Portuguese or you may contribute new translations for Spanish, Italian or your own language. Join the translation project at https://poeditor.com/join/project/QIaCp4bThS - fix #795: Session count when using Tomcat cluster with sessions replication, after restarting one instance. - fix NullPointerException when getting an Oracle explain plan for a SQL request from the optional collect server. - fix for Prometheus integration: exclude metrics which have no sense (javamelody_log_duration_millis, javamelody_log_errors_count, javamelody_error_errors_count) and metrics for statistics which are not displayed in the reports (e1db7c5, c0f34a2) - fix #806 for Prometheus integration again: it was printed '<?>' instead of NaN, for 'lastValue' on Java 8 and before.
    Liferay Portal 6.1 CE GA2+
    1.75.0 Compatibility with Liferay 7.1 Fix #794 Compatibility with Google App Engine using Java 8. Fix #779 When using JSVC to launch Tomcat, InternalError: errno: 13 error: Unable to open directory /proc/self/fd Enhanced: added X-Frame-Options: SAMEORIGIN in the reports. Added the Offline viewer tool for some degraded cases: If ever you don't have access to the online reports of javamelody on the running server, or if you want to view the reports of aggregated data for several instances of an application and you don't use the optional collect server and separated reports are not enough, or if you want to view the reports but the server is no longer running, or if you want some pdf reports and you have not included the iText dependency, then the offline viewer may be for you. See doc
    Liferay Portal 6.1 CE GA2+
    1.74.0 - It is a recommended upgrade for security to fix a XML External Entity (XXE) processing vulnerability. CVE-ID is CVE-2018-15531. Thanks to mounsurf & huanying for reporting the vulnerability. - fix sql monitoring from jndi datasource when Tomcat's ServerInfo.properties is customized - fix: do not require Log4J when sending metrics to InfluxDB or Datadog. - added: native calendar widget to choose dates for a custom period (with help from my colleague Fabien at KleeGroup) - added: it is now possible to customize css and js of the monitoring reports by adding the /net/bull/javamelody/resource/themedMonitoring.css and /net/bull/javamelody/resource/themedMonitoring.js files as resources in your application, in order to override or add values. This is the case for example in the javamelody dark theme which is ready to use as a Maven dependency in your pom.xml: <dependency> <groupId>net.bull.javamelody</groupId> <artifactId>javamelody-dark-theme</artifactId> <version>1.0</version> </dependency>
    Liferay Portal 6.1 CE GA2+
    1.73.1 Compatibility with JDK 9: -Djdk.attach.allowAttachSelf=true is no longer required to have heap histogram and fix the display of source of a JDK class.
    Liferay Portal 6.1 CE GA2+
    1.73.0 - Compatibility with JDK 9: fix heap dump and heap histogram, display again the graphs of cpu, opened files and physical memory. Note: to have the memory histogram in JDK 9 or later, add -Djdk.attach.allowAttachSelf=true in the java command line. - Fix "no token found" with Prometheus integration for a Windows server. - Enhancement: After generating a heap dump, zip it to reduce its size. - Added: The mean number of allocated Kilobytes per request is now displayed in the stats, next to the mean cpu per request. It is the memory used in the heap per request and which will have to be cleaned by the Garbage Collector later. And when more memory is used per request, more cpu will be used by the GC. As an example, 1 Gb allocated in a request, without a good reason, is probably a problem. - Added: when crash logs (hs_err_pid*.log files) are found, display them in the system actions. - Added: in the zoomed charts, display of the 95th percentile line. It shows what would be the maximum on the period if 5% of the highest values (short peaks) were excluded. - fix rare issue: ArithmeticException: / by zero in JRobin RRD files. - Removed the prometheus-include-last-value javamelody parameter and replaced it by the includeLastValue http parameter (see doc in wiki).
    Liferay Portal 6.1 CE GA2+
    1.72.0 Fix #737 for StatsD integration. Fix #731: When using CloudWatch, Cloudwatch metric upload can't handle more then 20 items (with help from marcrelation). Fix #668: RrdException: Invalid timestamps specified in some particular case when using custom period. Enhanced: when using the optional collect server and when having several nodes in a monitored application, if a node is unavailable, continue to collect data with the others (#736).
    Liferay Portal 6.1 CE GA2+
    1.71.0 - Fix #700 for Prometheus integration (with help from Stefan Penndorf). - Fix #701 for Datadog integration (PR #702, thanks to bluegaspode). - Fix #718: NPE when displaying the webapp dependencies in some particular case. - improved: Warn in the reports if multiple instances use the same storage directory (#692) - improved: If the application-name parameter is defined, use it when publishing metrics to InfluxDB, Graphite, StatsD, CloudWatch or Datadog instead of the context path (#694) - added: When using the reports by mail, a new javamelody parameter mail-subject-prefix can be used to configure the subject of the mail notification. For example, in a Tomcat context file: <Parameter name='javamelody.mail-subject-prefix' value='Production environment JavaMelody reports for {0}' override='false'/> (PR #710, thanks to vkpandey82) - added: In the External API, the url monitoring?part=lastValue&format=json now returns all the last values by names. (The url monitoring?part=lastValue&graph=usedMemory already returns the last value of a single graph by name.)
    Liferay Portal 6.1 CE GA2+
    1.70.0 - added: integration with Prometheus: Metrics are already displayed in the monitoring reports. You can also scrape the same metrics from Prometheus at the frequency you wish for advanced visualizations, if you have a Prometheus server installed (thanks to slynn1324). See doc: https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#exposing-metrics-to-prometheus - added integration with StatsD: Metrics are already displayed in the charts of the monitoring reports. As an extra, you can also publish the same metrics to StatsD, if you have a StatsD daemon installed. The parameter is statsd-address, see doc: https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#sending-metrics-to-statsd - upgrade prototype.js, effects.js and slider.js
    Liferay Portal 6.1 CE GA2+
    1.69.0 - added integration with InfluxDB: Metrics are already displayed in the charts of the monitoring reports. Like integrations with Graphite and AWS CloudWatch, you can also publish the same metrics to InfluxDB for advanced visualizations, if you have an InfluxDB server installed. The parameter is influxdb-url, see doc: https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#sending-metrics-to-influxdb - added integration with Datadog: Like for InfluxDB, you can also publish the same metrics to Datadog for advanced visualizations. The parameter is datadog-api-key, see doc: https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#sending-metrics-to-datadog
    Liferay Portal 6.1 CE GA2+
    2017-09-09 - improved (Brazilian) Portuguese translation (thanks to Sandro Giacomozzi). - Internal classes moved: Many internal classes, which were not public and all in the net.bull.javamelody package, are now moved to net.bull.javamelody.internal.* packages. - added integration with Graphite: Metrics are already displayed in the charts of the monitoring reports. As an extra, you can also publish the same metrics to Graphite for advanced visualizations in itself or in Grafana, if you have a Graphite server installed. The parameter is graphite-address, see doc: https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#sending-metrics-to-graphite - added integration with AWS CloudWatch: Like for Graphite, you can also publish the same metrics to AWS CloudWatch for custom visualizations and mail or autoscaling alarms, if you have an AWS EC2 server instance with detailed monitoring in AWS CloudWatch. The parameter is cloudwatch-namespace, see doc: https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#sending-metrics-to-aws-cloudwatch - added: In the list of threads, add an action to send an interrupt signal to a thread. The thread can test Thread.currentThread().isInterrupted() to stop itself. - added: PDF link in the threads page
    Liferay Portal 6.1 CE GA2+
    2017-07-19 - added: Real User Monitoring (RUM). It allows to measure the experience from the end user perspective, by monitoring times in the browser for each html page until it is displayed and ready to be used (b85652a). - The Real User Monitoring works by injecting on the fly a Boomerang javascript at the end of html pages, just before the </body> end tag, which sends data back to the monitoring in your server. Then in the detailed monitoring report of http requests for html pages, times and percentages are displayed for Network, Server execution, DOM processing and Page rendering, to compare which ones contribute to a good or bad end user experience. The Real User Monitoring does not add a noticeable overhead on the server, but the javascript adds a simple http(s) call for each html page, which may add a small overhead on the client browser. - This Real User Monitoring is not enabled by default. To enable it, add the system property -Djavamelody.rum-enabled=true - added: In the database reports, 10 new reports for MySQL (with help from MySQL perf analyzer, Apache license): long running queries, statistics of tables, unused indexes, events waits summary, table access summary, index access summary, table lock wait summary, tables without PK, queries summary for the last 24h, memory summary (this last one works only in MySQL v5.7) and 1 new report for Oracle database: statistics of tables (62d86d1). - fix #617: Charts of http/sql stats can not be viewed after restarting the application (with help from goldyliang). - fix: If the monitoring of an invalid JNDI datasource fails, don't ignore the others (dca0b07). - added: Display the number of http sessions and sessions mean size before the list of sessions, when there are more than 20 (PR #629, thanks to Aleksandr Mashchenko).
    Liferay Portal 6.1 CE GA2+
    2017-06-01 - fix compatibility with Java 9. (PR #609 for issue #556 , thanks to James Pether Sörling) - fix compatibility with Liferay 7 (649fd35 and PR #7 with help from Inácio Nery from Liferay) - improved: make easier the selection of the stack-trace text in the tooltips of the threads list (736cf0e) - added: pdf report in the detail page of a request. (28e2474) - added: links to view java source from errors and threads stack-traces. (e5263bf) - Source from the JDK and source from artifacts built by Maven and available in Maven central can be viewed. So if your server uses a JRE and not a JDK, source from the JDK are not available. And note that many artifacts available in Maven central were not built by Maven, for example Tomcat libraries, so sources of those artifacts can't be located. - added: if the javamelody parameter -Djavamelody.jmx-expose-enabled=true is set, then javamelody mbeans are available with aggregated statistics data about requests. (PR #591 thanks to Alexey Pushkin)
    Liferay Portal 6.1 CE GA2+
    Liferay Portal 6.1 CE GA2+
    Emeric Vernat
    Published Date
    April 17, 2022
    Supported Versions

    Installation Instructions

    This is a Legacy App that is no longer available in the new App Marketplace. You are able to acquire it from your installed DXP or CE instance and install it by following the instructions below.

    Acquiring this App through the legacy Liferay Portal Store

    1. Review app documentation for any specific installation instructions.
    2. Login to your Liferay Portal instance with administrative permissions.
    3. Navigate to the Control Panel, Marketplace (or Apps for 7.3 and prior), then Store.
    4. If needed, login to your Liferay.com account by choosing Sign In.
    5. Search for the app name in the Search dialog.
    6. Once the app is found, click on the app in the search results.
    7. On the app details page, choose to acquire the app by selecting the Free, Buy, or Trial button.
    8. Follow the instructions on the screen to complete the acquisition.

    Installing this App through legacy Liferay Portal Purchased Apps

    1. After acquiring the app, login to your Liferay Portal instance with administrative permissions.
    2. Navigate to the Control Panel, Marketplace (or Apps for 7.3 and prior), then Purchased.
    3. If needed, login to your Liferay.com account by choosing Sign In.
    4. Click the Install button to install your app on your Liferay Portal instance.

    See the legacy App Marketplace help documentation for more information.