Persisting Glowroot Configuration in Docker

Persisting Glowroot Configuration to survive a Docker restart

As many of you will already know, Liferay has been shipping Glowroot as part of the Liferay DXP bundles and Docker images from the 2023.Q4 Quarterly Release onwards.

For customer who are using a Liferay PaaS standard subscription (i.e. non High Availability) or Liferay Self-Hosted with Docker (and optionally Kubernetes) you may have noticed that the default behavior is that the Data and any Configuration changes made in Glowroot are not persisted, meaning they don't survive a restart.

We have documented how to enable Glowroot in Docker for Self-Hosted here:

https://learn.liferay.com/w/dxp/system-administration/using-glowroot-with-liferay

We have documented how to enable Glowroot in Liferay PaaS with persistent data in an un-clustered environment here:

https://learn.liferay.com/w/liferay-cloud/support-and-troubleshooting/troubleshooting-tools-and-resources/enabling-glowroot-on-paas

To make full use of Glowroot you may choose to configure external integrations such as:

  • Email Alerts (along with Outbound SMTP)
  • Slack webhook
  • Healthchecks.io
  • PagerDuty

Or:

  • Define custom Instrumentations
  • Define additional Gauges
  • Update Configuration Settings such as Transactions > Slow Threshold (or Slow threshold override)
  • Update 'Max query aggregates per transaction aggregate' and 'Max service call aggregates per transaction aggregate' default values to prevent occurrences of 'LIMIT EXCEEDED BUCKET'

But when Glowroot is restarted all of those custom configurations are lost.

Follow these steps to use persistent configuration in Glowroot:

1. Add the following to JVM Options:

-Dglowroot.conf.dir

For example in Liferay PaaS append this to LIFERAY_JVM_OPTS:

-Dglowroot.conf.dir=/mnt/persistent-storage/glowroot-conf

For example in Liferay Self-Hosted:

-Dglowroot.conf.dir=/glowroot-conf

  • where /glowroot-conf is a mount volume etc.

2. Add the admin.json file from the glowroot folder of the Liferay bundle to the Glowroot configuration folder from above (for the Liferay authentication integration to continue to work).

3. On next Glowroot startup a config.json file will be created in the persistent Glowroot configuration folder from above. Any changes made in the Glowroot GUI will be saved to this configuration file.

4. On restart the configuration from this file should be reloaded.

For a clustered Liferay Self-Hosted environment you can try sharing the same file across each instance.

Note: For persistent data in a clustered Liferay Docker based environment, use the Central Controller architecture.