Monday, July 26, 2021

Liferay Portal Monitoring with Prometheus and Grafana

Grafana is popular open-source solution for monitoring applications. It will provide graphical dashboards to build monitoring visualization.


Any graphical view required data or metrics, so metrics data will be provided by Prometheus.


Prometheus is another monitoring tools to pull data from different application with help of JMX Exporter Agent.


Grafana is ability to connect Prometheus to pull metrics data and it will be represented as graphical view. We can build nice dashboards to show metrics data in different graphical view in the Grafana web UI.


Setup a Liferay Cluster


Following are steps to Demonstrate Liferay Cluster Monitoring.


  • Setup Prometheus for Liferay Cluster
  • Install Grafana
  • Configure Prometheus Data source in Grafana
  • Create Liferay Cluster Dashboard


Setup Prometheus for Liferay Cluster

Follow the below article to setup Prometheus for Liferay cluster.


After configured JMX Exporter for Liferay Portal, Start all servers in the cluster.


Install Grafana


Follow the below article to install Grafana on windows.


Configure Prometheus Data source in Grafana

Now it’s time to configure Prometheus Data source in Grafana. Prometheus already have metrics data which is pulled from Liferay portal server with help of JMX exporter Java agent. That is already covered in the previous step.


Access Grafana Web UI with following URL








Home page click on Setting and Under Configuration click on “Data sources



Click on Add Data source.



Select Prometheus Data source in the List.



Provide Prometheus URL where its running. Default port is 9090. Once provided required information click on Test &Save.  Grafana successfully connected to Prometheus data source.







Create Liferay Cluster Dashboard

Grafana home page click on Dashboard icon and Click on Manage



There are free available Grafana dashboards for Tomcat. Creating Grafana dashboard is very easy and it’s just need to import Dashboard JSON file.


Go to following URL and get Grafana Tomcat dashboard file to local.





Import “tomcat-dashboard_rev10.json” file into Grafana dashboard.


Click on import button.



Click on Upload JSON file button and Select “tomcat-dashboard_rev10.json” file from local drive.


Once selected file, click on import then Dashboard will be imported into Grafana.






Go to Dashboards in the Grafana home page and select Tomcat Dashboard.



We Can see Dashboard with many panels and all metrics will be represented as Graphs.


Dashboard Screen: 1




We can edit Dashboard based on metrics provided by Prometheus or JMX Exporter.


We can see all Metrics with following JMX URL’s and these metrics attribute keys are matching in Grafana Dashboard JSON file. This is how Grafana build dashboards based on JMX Metrics.













Recent Posts

Recent Posts Widget

Popular Posts