Rendering probes

The rendering probes monitor the time taken to render pages, area and components by the rendering engine. Unlike most other probes, the rendering probes must be configured in the rendering engine, not the Instrumentation module.

The rendering probes can capture the following:

  • what is being rendered (a page, area or component)

  • the template being rendered

  • the path being rendered

These are included as labels to a measurement. You can use the labels in queries to narrow down the results returned.

The rendering probes are implemented as rendering engine listeners (info.magnolia.rendering.listeners.AbstractRenderingListener) and are called as the rendering engine is executed.

RenderingProbe

The RenderingProbe the time it takes to render pages, area and components.

Configuration properties

Property Description Required

class

Should be info.magnolia.services.instrumentation.probes.rendering.RenderingProbe.

name

The name of the rendering listener.

The name of the rendering listener will not be used as the Prometheus metric name. The metric name is specified by the probeName property.

enabled

Enable or disable the collection of rendering metrics for this probe.

Default = true

probeName

The metric name.

probeDescription

A description of the metric.

Metrics

Metric Description

<metric-name>

The configured metric name.

Labels

Label Metric Description

target

<metric-name>

What is being rendered, one of:

  • page

  • area

  • component

  • unknown (if none of the above)

path

<metric-name>

The path of the item being rendered.

template

<metric-name>

The template being rendered.

Format <module name>:<template path>

Example

RenderingProbe example config

RenderingSummaryProbe

The RenderingSummaryProbe keeps a running total of the time it takes to render pages, area and components.

RenderingSummaryProbe uses the Prometheus Summary (io.prometheus.client.Summary) collector. RenderingSummaryProbe is easier to work when creating histogram or heat maps of rendering time distributions.

Configuration properties

Property Description Required

class

Should be info.magnolia.services.instrumentation.probes.rendering.RenderingSummaryProbe.

name

The name of the rendering listener.

The name of the rendering listener will not be used as the Prometheus metric name. The metric name is specified by the probeName property.

enabled

Enable or disable the collection of rendering metrics for this probe.

Default = true

probeName

The metric name.

probeDescription

A description of the metric.

Metrics

Metric Description

<metric-name>

The configured metric name.

Labels

Label Metric Description

target

<metric-name>

What is being rendered, one of:

  • page

  • area

  • component

  • unknown (if none of the above)

path

<metric-name>

The path of the item being rendered.

template

<metric-name>

The template being rendered.

Format <module name>:<template path>

Example

RenderingSummaryProbe example config

RenderingSummaryProbe

Unlike other probes that report their measurements to Prometheus, the RenderingLogger probe will report rendering times to a logging destination.

RenderingLogger simply logs each rendering time along with the target, path and template to a log.

RenderingLogger can be configured to output a log in a convenient, easy to import CSV (comma separated values) text format, that can be imported for further analysis. By default, the log message created by RenderingLogger will be:

{0},{1},{2},{3},{4}

where the placeholders above are:

  • 0 = the rendering target, either page, area, component or unknown

  • 1 = the path

  • 2 = the template

  • 3 = the rendering time in milliseconds

RenderingLogger, because it can produce a very large number of logging messages, may not be suitable for use with Magnolia instances rendering lots of items since it may reduce Magnolia performance.

We recommend RenderingLogger and its logging configuration to set up as follows:

  • the rendering logging messages should be directed to a separate log destination to avoid overwhelming regular Magnolia logs

  • the log destination should be controlled (limited to a set size, with a set number of backups retained) to avoid taking up excessive amounts of storage

Configuration properties

Property Description Required

class

Should be info.magnolia.services.instrumentation.probes.RenderingLogger.

name

The name of the rendering engine listener.

The name of the rendering engine listener will not be used as the logger name.

loggerName

The logger name.

Default
info.magnolia.services.instrumentation.probes.rendering.RenderingLogger

loggerFormat

An output format suitable for use with java.text.Message (see java.text.MessageFormat).

The valid placeholders are:

  • 0 - the rendering target

  • 1 - the path of the item being rendered

  • 2 - the template ID

  • 3 - the rendering time in milliseconds

Default
{0},{1},{2},{3}

Metrics

Metric Description

<metric-name>

The configured metric name.

Labels

Label Metric Description

target

<metric-name>

What is being rendered, one of:

  • page

  • area

  • component

  • unknown (if none of the above)

path

<metric-name>

The path of the item being rendered.

template

<metric-name>

The template being rendered.

Format <module name>:<template path>

Example

RenderingSummaryProbe example config

Log4j

Here’s a simple log4j appender to capture the logging output from RenderingLogger to a log file name monitor-rendering.log, limited to 10 megabytes and 5 backups:

<appender name="monitor-rendering" class="org.apache.log4j.RollingFileAppender">
  <param name="File" value="logs/monitor-rendering.log" />
  <param name="MaxFileSize" value="10MB" />
  <param name="MaxBackupIndex" value="5" />
  <param name="Append" value="true" />
  <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss},%m%n" />
  </layout>
</appender>

And here’s a log4j category to generate the logging messages:

<category name="info.magnolia.services.instrumentation.probes.rendering.RenderingLogger">
  <priority value="DEBUG"/>
  <appender-ref ref="monitor-rendering"/>
</category>
No metrics or labels are provided; cache activity is logged rather than collected by Prometheus.
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