Metrics guide
The Instrumentation module and the default configuration for probes will provide a wide variety of metrics for collection with Prometheus. This guide describes each of the metrics available, their labels and their results.
Most, though not all of the probes, allow you to configure the metric name through the usual means of Magnolia configuration. However, some metrics have names that cannot be configured, particularly the JVM probes.
The v2.0
release of the Instrumentation module and the default instrumentation configuration module marks a major overhaul in the naming of metrics collected by the instrumentation probes.
As of v2.0
, metric names should conform to Prometheus’s proposed naming convention. If you add your own instrumentation probes, please follow the Prometheus naming convention.
This guide describes:
-
The metric name (plus Pre-v2.0 name and v1.6 name if different)
-
The metric value
-
Metric labels
-
Source probe for the metric
-
Notes on any peculiarities or gotchas for the metric
-
Some sample Prometheus queries
Cache metrics
mgnl_cache_total
Current name |
|
Pre-v2.0 name |
|
Probe |
|
Value |
An accumulating count of Magnolia cache operations (label: operation) per defined cache (label: cache), path (label: path) and domain. |
Configuration |
|
Metric labels
Label | Notes | ||
---|---|---|---|
|
The cache name, "defaultPageCache" in the default instrumentation configuration. |
||
|
One of:
|
||
|
The cache domain as defined in the cache key or n/a if not specified or not applicable.
|
||
|
The path (or key) of the cached item or n/a if not specified or not applicable.
|
Example queries
Total number of cache gets on the cache defaultPageCache for all paths and domains.
sum(mgnl_cache_total{cache="defaultPageCache",operation="get"})
Current number of cache gets for "/.resources/defaultMagnoliaLoginForm/login.css" from the cache "defaultPageCache" for all domains.
mgnl_cache_total{cache="defaultPageCache",operation="get",path="/.resources/defaultMagnoliaLoginForm/login.css"}
Filter Chain metrics
mgnl_filterChain_requests_total
Current name |
|
||
Pre-v2.0 name |
|
||
Probe |
|||
Value |
An accumulating count of requests reaching the probe in filter chain.
|
||
Configuration |
|
mgnl_servletContext
Current name |
|
Pre-v2.0 name |
|
Probe |
|
Value |
Always 1, all the interesting information about the servlet context is stored as labels. |
Configuration |
|
Metric labels
Label | Notes |
---|---|
|
the context path of the Magnolia web app |
|
the major version of the Servlet API in use |
|
the minor version of the Servlet API in use |
|
the server info of the web container (e.g. Tomcat) |
|
the servlet context name (the value of the display-name for the web app defined in web.xml) |
Example queries
The servlet context info for all available Magnolia instances.
mgnl_filterChain_servletContext
The servlet context info for all available Magnolia instances using the Servlet API 2.0.
mgnl_filterChain_servletContext{majorVersion="4",minorVersion="0"}
mgnl_filterChain_request_duration_details_seconds
Current name |
|
||
Pre-v2.0 name |
|
||
Probe |
|||
Value |
The duration of the request in seconds.
|
||
Configuration |
|
Metric labels
The labels used are configurable, the labels below may or may not be present depending on the probe configuration.
Label | Notes | ||
---|---|---|---|
|
the request method (e.g.
|
||
|
the request URL
|
Example queries
Get the average request duration in seconds for the specified Magnolia instance over the last 10 minutes.
avg_over_time(mgnl_filterChain_request_duration_details_seconds{job="<Prometheus job>",instance="<Magnolia instance>"}[10m])
Get the average request duration in seconds for the root page over the last 10 minutes.
avg_over_time(mgnl_filterChain_request_duration_details_seconds{job="<Prometheus job>",instance="<Magnolia instance>", request_url="/"}[10m])
mgnl_filterChain_request_duration_seconds
Current name |
|
||
Pre-v2.0 name |
|
||
Probe |
|||
Value |
The duration of the request in seconds.
|
||
Configuration |
|
Metric labels
The labels used are configurable, the labels below may or may not be present depending on the probe configuration.
Label | Notes | ||
---|---|---|---|
|
the request method (e.g.
|
||
|
the request URL
|
Example queries
Get the average request duration in seconds for the specified Magnolia instance over the last 10 minutes.
avg_over_time(mgnl_filterChain_request_duration_seconds{job="<Prometheus job>",instance="<Magnolia instance>"}[10m])
Rendering metrics
mgnl_renderingTime_seconds
Current name |
|
Pre-v2.0 name |
|
Probe |
|
Value |
The time spent rendering the element (page, area or component) in seconds. |
Configuration |
|
Metric labels
Label | Notes |
---|---|
path |
The element path. |
target |
The page, area, or component. |
template |
The template identifier. |
Example queries
Get the top 10 components by total time spent rendering.
topk(10,mgnl_renderingTime_seconds{job="<Prometheus job>",instance="<Magnolia instance>",target="component"}) by (path))
mgnl_renderingTime_summary_seconds
mgnl_renderingTime_summary_seconds
, mgnl_renderingTime_summary_seconds_sum
and mgnl_renderingTime_summary_seconds_count
are relative to the quantiles configured by the probe.
Current name |
Options:
|
Pre-v2.0 name |
Previous:
|
Probe |
|
Value |
Seconds |
Configuration |
|
Metric labels
Label | Notes |
---|---|
path |
The element path. |
target |
The page, area, or component. |
template |
The template identifier. |
quantile |
Between 0 and 1, present in mgnl_renderingTime_summary_seconds metric only! Value of quantile label depends on the quantile configured by the probe. By default, the following quantiles are defined:
|
Example queries
Get the top 10 components by total time spent rendering.
topk(10,mgnl_renderingTime_seconds{job="<Prometheus job>",instance="<Magnolia instance>",target="component"}) by (path))
Magnolia metrics
mgnl_instance
Current name |
|
Pre-v2.0 name |
|
Probe |
|
Value |
Values:
|
Configuration |
|
mgnl_license_expiration
Current name |
|
Pre-v2.0 name |
n/a |
Probe |
|
Value |
The epoch time in seconds when the Magnolia expires. |
Configuration |
|
Metric labels
Label | Notes |
---|---|
|
the license module name or "NA" |
|
the license owner or "NA" |
|
the license status message or "NA" |
|
the epoch time (in seconds) when the license expires |
mgnl_license_status
Current name |
|
Pre-v2.0 name |
n/a |
Probe |
|
Value |
Always 0.0. |
Configuration |
|
Metric labels
Label | Notes |
---|---|
|
the license module name or "NA" |
|
the license owner or "NA" |
|
the license status message or "NA" |
|
the epoch time (in seconds) when the license expires |
JVM metrics
jvm_classes_loaded
*
Current name |
Names:
|
Pre-v2.0 name |
Same as current. |
Probe |
|
Value |
|
Configuration |
|
jvm_gc_collection_seconds_count
*
Current name |
Names:
|
Pre-v2.0 name |
Same as current. |
Probe |
|
Value |
|
Configuration |
|
Metric labels
Label | Notes | ||
---|---|---|---|
|
Garbage collection method, e.g. G1 Old Generation, G1 Young Generation, Copy, MarkSweepCompact, etc.
|
jvm_info
Current name |
|
||
Pre-v2.0 name |
Same as current. |
||
Probe |
|||
Value |
Always 1.0
|
||
Configuration |
|
Metric labels
Label | Notes |
---|---|
|
Something like "11.0.8+10", actual value depends on the JVM in use. |
|
Something like "Yoyodyne Propulsion Systems Corporation", actual value depends on the JVM in use. |
|
Something like "OpenJDK Runtime Environment", actual value depends on the JVM in use. |
jvm_memory_bytes_used
*
Current name |
|
Pre-v2.0 name |
Same as current. |
Probe |
|
Value |
|
Configuration |
|
Metric labels
Label | Notes |
---|---|
|
"heap" or "nonheap" Present in jvm_memory_bytes_used, jvm_memory_bytes_committed, jvm_memory_bytes_max, jvm_memory_bytes_init |
|
Label values depend on JVM in use and configuration, could be things like "G1 Old Gen", "Metaspace" or "Compressed Class Space". Present in jvm_memory_pool_bytes_used, jvm_memory_pool_bytes_committed, jvm_memory_pool_bytes_max, jvm_memory_pool_bytes_init |
jvm_threads_current
*
Current name |
|
Pre-v2.0 name |
Same as current. |
Probe |
|
Value |
|
Configuration |
|