The Magnolia Instrumentation module provides "probes" for monitoring Magnolia internal metrics and activities over time. The probes are configurable within Magnolia and can be turned on and off. New probes can be added to Magnolia while it is running without restarting.
The probes provide their measurements to an external Prometheus server, a free and open source monitoring product, for storage. Prometheus stores the measurements in a time series database. The measurements stored in Prometheus can be accessed by other services to query and extract the measurements.
Grafana is an external server capable of analyzing and displaying time series from Prometheus and displaying the results in a graphs and dashboards. Grafana dashboards can contain bar graphs, line graphs, tables, dials, pie charts, text, histograms, heat maps and other visualizations of Prometheus time series data.
This module is at the INCUBATOR level.
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
Instrumentation module (Magnolia provided, to be installed by the customer)
Standard configuration of instrumentation probes (Magnolia provided, to be installed by the customer)
Standard Grafana dashboards for instrumentation probes (Magnolia provided, to be installed by the customer)
Grafana server (customer provided)
Prometheus server (customer provided)
In the on premise solution, the Prometheus server collects the metrics measurements directly for the monitored Magnolia instance (a.k.a. "pull").
The cloud monitoring solution includes:
Instrumentation module (Magnolia provided)
Standard configuration of instrumentation probes (Magnolia provided)
Cloud instance with configured Prometheus, Grafana and data collection server (Magnolia provided)
In the cloud solution, the monitored Magnolia instance pushes metric measurements to the data collection server (a.k.a. "push").
Installing Monitoring
Depending on the solution, on premise or cloud service, one or more of the following must be installed:
the Magnolia instrumentation module
configuration for instrumentation probes (may be bundled as a Magnolia module)
Grafana server, plus configuration and dashboards (on premise solution only)
Prometheus server plus configuration (on premise solution only)
A probe will collect at least one metric. Each metric will be available in the Prometheus server and you can query Prometheus for the metric as well as applying various functions to manipulate the returned results.
Metrics collected by Prometheus can be further distinguished by labels identifying characteristics associated with a measurement of a metric. You can use measurement labels to group or filter results returned from Prometheus.
A metric will make measurements with a value. Every measurement will also have labels. Each label will have a value.
For example, consider the rendering probe: the rendering probe adds additional information about the rendering time that was measured as labels, including the following labels:
Identifies the Prometheus job that collected the measurement. Prometheus adds this label to all collected measurements.
2
Identifies the host the measurement was collected from. Prometheus adds this label to all collected measurements.
3
Identifies the path being rendered.
4
Identifies what is being rendered, a page, area or component.
5
Identifies the template being executed.
Labels allow you to refine your Prometheus queries for specific measurements - say the rendering times for just pages, or the rendering time of a specific template - and build a dashboard display for the results.
Here are the labels common to all metrics stored by Prometheus:
Label
Description
job
The Prometheus job name that collected the measurement, the label value corresponds to a job defined in the Prometheus configuration.
instance
Identifies the host instance defined in the Prometheus job that collected the measurement
Instrumentation module probes
Some of the probes in the Instrumentation module are defined as part of the module configuration. There are common properties for probes defined in the instrumentation module, including:
class - the full class name of the instrumentation probe to instantiate, for example, info.magnolia.services.instrumentation.probes.jvm.ClassLoadingProbe.
enabled - a flag, either true or false, true indicating the probe is active and collecting metrics and false if not.
Probes defined in the instrumentation module are created or modified when the instrumentation module is restarted or changed.
Common properties:
Property
Default
Description
class
none
The fully qualified class name of the probe to instantiate. The class must implement the info.magnolia.services.instrumentation.probes.LaunchableProbe interface.
enabled
true
Flag controlling if the probe is active and can provide measurements (true) or is disabled and not providing measurements (false).
Instrumentation dashboards
Grafana dashboards are easy to make and customize to meet different needs. The following dashboards are currently available:
Magnolia: About - visualizes details about the Magnolia server
Magnolia: Cache - visualizes results of cache probes
Magnolia: Filter Chain - visualizes results of filter chain probes
Magnolia: JVM - visualizes results of JVM probes
Magnolia: Logging- visualizes results of logging probes
Magnolia: Rendering - visualizes results of rendering probes
Magnolia: System - visualizes results of system probes
Magnolia: Versions - visualizes results of modules probes
OS: Metrics - visualizes runtime metrics of OS and JVM probes
OS: Metrics (alternate) - visualizes runtime metrics of OS and JVM probes
Tomcat: Health - visualizes Tomcat metrics obtained through JMX probes