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

mgnl_cache_total

Pre-v2.0 name

cache

Probe

Value

An accumulating count of Magnolia cache operations (label: operation) per defined cache (label: cache), path (label: path) and domain.

Configuration

/modules/cache/config/contentCaching/defaultPageCache/listeners/defaultPageCache

Metric labels

Label Notes

cache

The cache name, "defaultPageCache" in the default instrumentation configuration.

operation

One of:

  • get

  • get_quiet

  • put

  • clear

  • remove

domain

The cache domain as defined in the cache key or n/a if not specified or not applicable.

The cache "clear" operation will have n/a for the domain value.

path

The path (or key) of the cached item or n/a if not specified or not applicable.

The cache "clear" operation will have n/a for the path value.

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

mgnl_filterChain_requests_total

Pre-v2.0 name

mgnl_total_requests

Probe

Value

An accumulating count of requests reaching the probe in filter chain.

Requests must match the voters configured for the filter probe; requests that do not match will not be counted.

Configuration

/server/filters/totalRequests

mgnl_servletContext

Current name

mgnl_servletContext

Pre-v2.0 name

servletContext

Probe

Value

Always 1, all the interesting information about the servlet context is stored as labels.

Configuration

/server/filters/servletContext

Metric labels

Label Notes

contextPath

the context path of the Magnolia web app

majorVersion

the major version of the Servlet API in use

minorVersion

the minor version of the Servlet API in use

serverInfo

the server info of the web container (e.g. Tomcat)

servletContextName

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

mgnl_filterChain_request_duration_details_seconds

Pre-v2.0 name

mgnl_filter_chain_time_detail

Probe

Value

The duration of the request in seconds.

Requests must match the voters configured for the filter probe; requests that do not match will not be timed.

Configuration

/server/filters/filterChainTimeDetail

Metric labels

The labels used are configurable, the labels below may or may not be present depending on the probe configuration.

Label Notes

request_method

the request method (e.g. GET, POST, PUT, …​)

The request_method label is included in default configuration.

request_url

the request URL

The request_url label is included in default configuration.

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

mgnl_filterChain_request_duration_seconds

Pre-v2.0 name

mgnl_filter_chain_time

Probe

Value

The duration of the request in seconds.

Requests must match the voters configured for the filter probe; requests that do not match will not be timed.

Configuration

/server/filters/measureFilterChain

Metric labels

The labels used are configurable, the labels below may or may not be present depending on the probe configuration.

Label Notes

request_method

the request method (e.g. GET, POST, PUT, …​)

The request_method label is included in default configuration.

request_url

the request URL

The request_url label is included in default configuration.

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

mgnl_renderingTime_seconds

Pre-v2.0 name

renderingTime

Probe

Value

The time spent rendering the element (page, area or component) in seconds.

Configuration

/server/rendering/engine/listeners/renderingProbe

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:

  • mgnl_renderingTime_summary_seconds: sum of rendering times per quantile

  • mgnl_renderingTime_summary_seconds_sum: sum total of all rendering times

  • mgnl_renderingTime_summary_seconds_count: count of samples in all quantiles

Pre-v2.0 name

Previous:

  • renderingSummary

  • renderingSummary_sum

  • renderingSummary_count

Probe

Value

Seconds

Configuration

/server/rendering/engine/listeners/renderingProbe

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:

  • 0.5, 5% error

  • 0.9, 1% error

  • 0.99, 0.1% error

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

mgnl_instance

Pre-v2.0 name

mgnlInstance

Probe

Value

Values:

  • 1.0 if a Magnolia author instance

  • 0.0 if a Magnolia public instance

Configuration

/modules/instrumentation/probes/instance

mgnl_license_expiration

Current name

mgnl_license_expiration

Pre-v2.0 name

n/a

Probe

Value

The epoch time in seconds when the Magnolia expires.

Configuration

/modules/instrumentation/probes/licenseExpiration

Metric labels

Label Notes

module

the license module name or "NA"

owner

the license owner or "NA"

message

the license status message or "NA"

status

the epoch time (in seconds) when the license expires

mgnl_license_status

Current name

mgnl_license_status

Pre-v2.0 name

n/a

Probe

Value

Always 0.0.

Configuration

/modules/instrumentation/probes/licenseStatus

Metric labels

Label Notes

module

the license module name or "NA"

owner

the license owner or "NA"

message

the license status message or "NA"

status

the epoch time (in seconds) when the license expires

JVM metrics

jvm_classes_loaded*

Current name

Names:

  • jvm_classes_loaded: current number classes loaded in the JVM

  • jvm_classes_loaded_total: total number of classes loaded into the JVM since starting

  • jvm_classes_unloaded_total: total number of classes unloaded from the JVM since starting

Pre-v2.0 name

Same as current.

Probe

Value

  • jvm_classes_loaded: current number of classes loaded in the JVM

  • jmv_classes_unloaded_total: total number classes unloaded from the JVM since starting

  • jmv_classes_loaded_total: total number of classes loaded into the JVM since starting

Configuration

/modules/instrumentation/config/probes/classLoading

jvm_gc_collection_seconds_count*

Current name

Names:

  • jvm_gc_collection_seconds_count: sum of time spent collecting garbage by GC method

  • jvm_gc_collection_seconds_sum: total number times garbage collection was invoked by GC method

Pre-v2.0 name

Same as current.

Probe

Value

  • jvm_gc_collection_seconds_count - sum of time spent collecting garbage by GC method

  • jvm_gc_collection_seconds_sum - total number times garbage collection was invoked by GC method

Configuration

/modules/instrumentation/config/probes/garbageCollection

Metric labels

Label Notes

gc

Garbage collection method, e.g. G1 Old Generation, G1 Young Generation, Copy, MarkSweepCompact, etc.

Label values depend on the JVM used and its configuration.

jvm_info

Current name

jvm_info

Pre-v2.0 name

Same as current.

Probe

Value

Always 1.0

Details about the JVM are saved as labels.

Configuration

/modules/instrumentation/config/probes/jvm

Metric labels

Label Notes

version

Something like "11.0.8+10", actual value depends on the JVM in use.

vendor

Something like "Yoyodyne Propulsion Systems Corporation", actual value depends on the JVM in use.

runtime

Something like "OpenJDK Runtime Environment", actual value depends on the JVM in use.

jvm_memory_bytes_used*

Current name

  • jvm_memory_bytes_used

  • jvm_memory_bytes_committed

  • jvm_memory_bytes_max

  • jvm_memory_bytes_init

  • jvm_memory_pool_bytes_used

  • jvm_memory_pool_bytes_committed

  • jvm_memory_pool_bytes_max

  • jvm_memory_pool_bytes_init

Pre-v2.0 name

Same as current.

Probe

Value

  • jvm_memory_bytes_used - current number of bytes used on the heap or nonheap

  • jvm_memory_bytes_committed - current number of bytes on the heap or nonheap

  • jvm_memory_bytes_max - maximum number bytes allowed on the heap or nonheap

  • jvm_memory_bytes_init - initial size of heap or nonheap in bytes

  • jvm_memory_pool_bytes_used - current number of bytes used in a memory pool

  • jvm_memory_pool_bytes_committed - current number of bytes committed in a memory pool

  • jvm_memory_pool_bytes_max - maximum size of a memory pool in bytes

  • jvm_memory_pool_bytes_init - initial size of a memory pool in bytes

Configuration

/modules/instrumentation/config/probes/memory

Metric labels

Label Notes

area

"heap" or "nonheap"

Present in jvm_memory_bytes_used, jvm_memory_bytes_committed, jvm_memory_bytes_max, jvm_memory_bytes_init

pool

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

  • jvm_threads_current

  • jvm_threads_daemon

  • jvm_threads_deadlocked

  • jvm_threads_deadlocked_monitor

  • jvm_threads_peak

  • jvm_threads_started_total

Pre-v2.0 name

Same as current.

Probe

Value

  • jvm_threads_current - current number of threads running in all states

  • jvm_threads_daemon - current number daemon threads running

  • jvm_threads_deadlocked - current number of deadlocked threads

  • jvm_threads_deadlocked_monitor - current number of deadlocked monitor threads

  • jvm_threads_peak - maximum number of running threads

  • jvm_threads_started_total - running total of threads

Configuration

/modules/instrumentation/config/probes/threads

Feedback

Incubators

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Instrumentation module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules